You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Brenden Capps <ca...@ORBITEC.com> on 2006/08/22 23:36:25 UTC

Problem Compiling Then Executing Xerces on Windows

First let me describe my environment.  The machine I am working on is a
Windows 2000 computer.  I am using cygwin version 2.510.2.2 as the
command line tool.  I am building xerces with the MinGW tools which
contains the GCC version 3.4.4.  The programs that are going to use
xerces are being built with the same tools.

 

I tried to follow the instructions to build it under cygwin, but they
failed.  Here is the build process I got to work.

 

export XERCESROOT=c:/softwareDevelopment/xerces-c-src_2_7_0/lib

./runConfigure -pcygwin -cmingw32-gcc -xmingw32-g++
-l"-Lc:/Programs/cygwin/lib
-Lc:/softwareDevelopment/xerces-c-src_2_7_0/lib -lcygwin"
-z"-Ic:/Programs/cygwin/usr/include"

 

# Note at this point the make files have commands like all:: include and
mingw32-make does not like the double colon so I had to do a find an
replace on all double colons and convert them to single colons in every
make file.

 

# I also had to change the prepare command in the base Makefile from

 

Prepare:

      @echo Preparing the directory structure for a build ...

      $Q${MKDIR} -p ${XML_OBJ_DIR}

      $Q${MKDIR} -p ${XML_OBJ_DEPDOM_DIR}

      $Q${MKDIR} -p ${XML_LIB_DIR}

      $Q${MAKE} -s -C $(UTIL_DIR) includes

      $Q${MAKE} -s -C $(SAX_DIR) includes

      $Q${MAKE} -s -C $(SAX2_DIR) includes

      $Q${MAKE} -s -C $(INTERNAL_DIR) includes

      $Q${MAKE} -s -C $(FRAMEWORK_DIR) includes

      $Q${MAKE} -s -C $(PARSERS_DIR) includes

      $Q${MAKE} -s -C $(VALIDATORS_DIR) includes

      $Q${MAKE} -s -C $(DOM_DIR) includes

 

# to

Prepare:

      @echo Preparing the directory structure for a build ...

      $Q${MKDIR} -p ${XML_OBJ_DIR}

      $Q${MKDIR} -p ${XML_OBJ_DEPDOM_DIR}

      $Q${MKDIR} -p ${XML_LIB_DIR}

      $Q${MAKE} -s -C $(UTIL_DIR) all

      $Q${MAKE} -s -C $(UTIL_DIR)/Compilers all

      $Q${MAKE} -s -C $(UTIL_DIR)/MsgLoaders/InMemory all

      $Q${MAKE} -s -C $(UTIL_DIR)/NetAccessors/Socket all

      $Q${MAKE} -s -C $(UTIL_DIR)/Platforms/Cygwin all

      $Q${MAKE} -s -C $(UTIL_DIR)/regx all

      $Q${MAKE} -s -C $(UTIL_DIR)/Transcoders/Cygwin all

      $Q${MAKE} -s -C $(SAX_DIR) all

      $Q${MAKE} -s -C $(SAX2_DIR) all

      $Q${MAKE} -s -C $(INTERNAL_DIR) all

      $Q${MAKE} -s -C $(FRAMEWORK_DIR) all

      $Q${MAKE} -s -C $(FRAMEWORK_DIR)/psvi all

      $Q${MAKE} -s -C $(PARSERS_DIR) all

      $Q${MAKE} -s -C $(VALIDATORS_DIR) all

      $Q${MAKE} -s -C $(VALIDATORS_DIR)/common all

      $Q${MAKE} -s -C $(VALIDATORS_DIR)/datatype all

      $Q${MAKE} -s -C $(VALIDATORS_DIR)/DTD all

      $Q${MAKE} -s -C $(VALIDATORS_DIR)/schema all

      $Q${MAKE} -s -C $(VALIDATORS_DIR)/schema/Identity all

      $Q${MAKE} -s -C $(DOM_DIR) all

      $Q${MAKE} -s -C $(DOM_DIR)/impl all

      $Q${MAKE} -s -C $(DOM_DIR)/deprecated all

 

# In the Makefile.incl I had to line 677 in Makefile.incl from 

 

LINK_LIBNAME=xerces-c

 

# To

 

LINK_LIBNAME=xerces-c27

 

# Once I had done all that then I could build it with the following
line.

mingw32-make

 

I'm not sure why I had to make the above modifications to get it to
compile, but I'm not sure if it resulted in a good dll.  Once I've built
the libraries, I've tried to link to the newly created dll's.  I got my
resulting code to compile, but if have any code that is linked to the
dll the program terminates immediately.  Even a program as simple as
hello world that calls XMLPlatformUtils::Initialize(); before the
printf() will not run properly.  Any ideas?

 

I also tried compiling the sample programs and it appears to be having
issues with the iostream library.  Any ideas there would also be
appreciated.

 

 

 

 


Re: Problem Compiling Then Executing Xerces on Windows

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi Brenden,

"Brenden Capps" <ca...@ORBITEC.com> writes:

> First let me describe my environment.  The machine I am working on is a
> Windows 2000 computer.  I am using cygwin version 2.510.2.2 as the
> command line tool.  I am building xerces with the MinGW tools which
> contains the GCC version 3.4.4.  The programs that are going to use
> xerces are being built with the same tools.

We successfully built Xerces-C++ for MinGW as a static library. The
application that uses it compiles and runs fine. The process is
described on this page:

http://codesynthesis.com/projects/xsd/extras/build-windows.xhtml

Scroll down to the "Xerces-C++" section.


hth,
-boris



-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding