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 Bidski <bi...@bigpond.net.au> on 2010/05/23 00:56:19 UTC
Building under Windows with MinGW
Hello,
Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1 under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or CygWin, just Windows and MinGW. MinGW was installed as part of CodeLite.
I do not have access to any version of Visual Studio and the Visual Studio compiled libraries appear to be causing my MinGW/G++ setup some grief during compiling/linking.
Thanks in advance
Bidski
Re: Building under Windows with MinGW
Posted by Bidski <bi...@bigpond.net.au>.
I receive a lot of undefined references
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:374: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni22fgXercescDefaultLocaleE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:374: undefined
reference to
`_imp___ZN11xercesc_3_116XMLPlatformUtils10InitializeEPKcS2_PNS_12PanicHandlerEPNS_13MemoryManagerE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:376: undefined
reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:376: undefined
reference to
`_imp___ZN11xercesc_3_116XMLReaderFactory15createXMLReaderEPNS_13MemoryManagerEPNS_14XMLGrammarPoolE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:378: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni20fgSAX2CoreNameSpacesE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:379: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni27fgSAX2CoreNameSpacePrefixesE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:380: undefined
reference to
`_imp___ZN11xercesc_3_16XMLUni30fgXercesValidationErrorAsFatalE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:382: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni20fgSAX2CoreValidationE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:383: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni14fgXercesSchemaE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:384: undefined
reference to `_imp___ZN11xercesc_3_16XMLUni26fgXercesSchemaFullCheckingE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:390: undefined
reference to
`_imp___ZN11xercesc_3_16XMLUni31fgXercesUseCachedGrammarInParseE'
./Debug/inventory.o:G:/PC/VC++/GCC/MRP/MRP/inventory.cpp:401: undefined
reference to `_imp___ZN11xercesc_3_116XMLPlatformUtils9TerminateEv'
./Debug/inventory.o: In function `ContentHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/ContentHandler.hpp:67: undefined
reference to `_imp___ZTVN11xercesc_3_114ContentHandlerE'
./Debug/inventory.o: In function `~ContentHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/ContentHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_114ContentHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/ContentHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_114ContentHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/ContentHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_114ContentHandlerE'
./Debug/inventory.o: In function `LexicalHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/LexicalHandler.hpp:53: undefined
reference to `_imp___ZTVN11xercesc_3_114LexicalHandlerE'
./Debug/inventory.o: In function `~LexicalHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/LexicalHandler.hpp:58: undefined
reference to `_imp___ZTVN11xercesc_3_114LexicalHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/LexicalHandler.hpp:58: undefined
reference to `_imp___ZTVN11xercesc_3_114LexicalHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/LexicalHandler.hpp:58: undefined
reference to `_imp___ZTVN11xercesc_3_114LexicalHandlerE'
./Debug/inventory.o: In function `DeclHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/DeclHandler.hpp:55: undefined
reference to `_imp___ZTVN11xercesc_3_111DeclHandlerE'
./Debug/inventory.o: In function `~DeclHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/DeclHandler.hpp:60: undefined
reference to `_imp___ZTVN11xercesc_3_111DeclHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DeclHandler.hpp:60: undefined
reference to `_imp___ZTVN11xercesc_3_111DeclHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DeclHandler.hpp:60: undefined
reference to `_imp___ZTVN11xercesc_3_111DeclHandlerE'
./Debug/inventory.o: In function `DTDHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax/DTDHandler.hpp:66: undefined reference
to `_imp___ZTVN11xercesc_3_110DTDHandlerE'
./Debug/inventory.o: In function `~DTDHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax/DTDHandler.hpp:71: undefined reference
to `_imp___ZTVN11xercesc_3_110DTDHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax/DTDHandler.hpp:71: undefined reference
to `_imp___ZTVN11xercesc_3_110DTDHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax/DTDHandler.hpp:71: undefined reference
to `_imp___ZTVN11xercesc_3_110DTDHandlerE'
./Debug/inventory.o: In function `EntityResolver':
G:/Xerces-c-3.1.1/include/xercesc/sax/EntityResolver.hpp:94: undefined
reference to `_imp___ZTVN11xercesc_3_114EntityResolverE'
./Debug/inventory.o: In function `~EntityResolver':
G:/Xerces-c-3.1.1/include/xercesc/sax/EntityResolver.hpp:99: undefined
reference to `_imp___ZTVN11xercesc_3_114EntityResolverE'
G:/Xerces-c-3.1.1/include/xercesc/sax/EntityResolver.hpp:99: undefined
reference to `_imp___ZTVN11xercesc_3_114EntityResolverE'
G:/Xerces-c-3.1.1/include/xercesc/sax/EntityResolver.hpp:99: undefined
reference to `_imp___ZTVN11xercesc_3_114EntityResolverE'
./Debug/inventory.o: In function `ErrorHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax/ErrorHandler.hpp:67: undefined
reference to `_imp___ZTVN11xercesc_3_112ErrorHandlerE'
./Debug/inventory.o: In function `~ErrorHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax/ErrorHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_112ErrorHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax/ErrorHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_112ErrorHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax/ErrorHandler.hpp:72: undefined
reference to `_imp___ZTVN11xercesc_3_112ErrorHandlerE'
./Debug/inventory.o: In function `DefaultHandler':
G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631: undefined
reference to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631: undefined
reference to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631: undefined
reference to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631: undefined
reference to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631: undefined
reference to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
./Debug/inventory.o:G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:631:
more undefined references to `_imp___ZTVN11xercesc_3_114DefaultHandlerE'
follow
./Debug/inventory.o:G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:667:
undefined reference to `_imp___ZN11xercesc_3_117SAXParseExceptionC1ERKS0_'
./Debug/inventory.o:G:/Xerces-c-3.1.1/include/xercesc/sax2/DefaultHandler.hpp:667:
undefined reference to `_imp___ZN11xercesc_3_117SAXParseExceptionD1Ev'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:537:
undefined reference to
`_imp___ZN11xercesc_3_116XMLPlatformUtils15fgMemoryManagerE'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:537:
undefined reference to
`_imp___ZN11xercesc_3_117SAXParseExceptionC1EPKtS2_S2_jjPNS_13MemoryManagerE'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:539:
undefined reference to `_imp___ZN11xercesc_3_117SAXParseExceptionD1Ev'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:539:
undefined reference to `_imp___ZN11xercesc_3_117SAXParseExceptionD1Ev'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:707:
undefined reference to `_imp___ZN11xercesc_3_113SchemaSymbols10fgXSI_TYPEE'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/parser/xerces/elements.txx:707:
undefined reference to `_imp___ZN11xercesc_3_113SchemaSymbols9fgURI_XSIE'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx:63:
undefined reference to
`_imp___ZNK11xercesc_3_117SAXParseException11getPublicIdEv'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx:66:
undefined reference to
`_imp___ZNK11xercesc_3_117SAXParseException11getSystemIdEv'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx:69:
undefined reference to
`_imp___ZNK11xercesc_3_117SAXParseException15getColumnNumberEv'
./Debug/inventory.o:G:/XSD-3.3.0/libxsd/xsd/cxx/xml/sax/bits/error-handler-proxy.txx:69:
undefined reference to
`_imp___ZNK11xercesc_3_117SAXParseException13getLineNumberEv'
along with these 2 warnings
G:/Xerces-c-3.1.1/include/xercesc/util/KVStringPair.hpp:176: warning: 'void
xercesc_3_1::KVStringPair::setKey(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
G:/Xerces-c-3.1.1/include/xercesc/util/KVStringPair.hpp:190: warning: 'void
xercesc_3_1::KVStringPair::setValue(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
compile command is
g++ -o ./Debug/MRP ./Debug/mrp_app.o ./Debug/mrp_frame.o ./Debug/catlist.o
./Debug/inventory.o ./Debug/InventoryXML.o ./Debug/resources.rc.o
"-LC:/wxWidgets/lib/gcc_dll" "-L." "-LC:/wxWidgets/lib/gcc_d"
"-LG:/Xerces-c-3.1.1/lib" -lxerces-c_3D -O2 -mthreads -LC:\wxWidgets\lib\gcc_dll
-lwxmsw28ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32
-luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32
-lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -mwindows
Bidski
--------------------------------------------------
From: "David Bertoni" <db...@apache.org>
Sent: Monday, May 24, 2010 5:22 AM
To: <c-...@xerces.apache.org>
Subject: Re: Building under Windows with MinGW
> On 5/22/2010 3:56 PM, Bidski wrote:
>> Hello,
>>
>> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1
>> under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or
>> CygWin, just Windows and MinGW. MinGW was installed as part of CodeLite.
>>
>> I do not have access to any version of Visual Studio and the Visual
>> Studio compiled libraries appear to be causing my MinGW/G++ setup some
>> grief during compiling/linking.
> What problems are you seeing?
>
> Dave
>
Re: Building under Windows with MinGW
Posted by David Bertoni <db...@apache.org>.
On 5/22/2010 3:56 PM, Bidski wrote:
> Hello,
>
> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1 under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or CygWin, just Windows and MinGW. MinGW was installed as part of CodeLite.
>
> I do not have access to any version of Visual Studio and the Visual Studio compiled libraries appear to be causing my MinGW/G++ setup some grief during compiling/linking.
What problems are you seeing?
Dave
Re: Building under Windows with MinGW
Posted by Bidski <bi...@bigpond.net.au>.
strange thing ...... i cleaned up a couple of my directories and got rid of
my old xerces directory (the one i was using before i compiled my own) then
re-compiled my program and all of a sudden its telling me that my
libxerces-c-3-1.dll (in the bin folder) is of an unrecognized file format.
it compiled fine earlier today (except for those warnings that I mentioned),
why would it fail now?
Bidski
--------------------------------------------------
From: "Boris Kolpackov" <bo...@codesynthesis.com>
Sent: Monday, May 24, 2010 11:50 PM
To: <c-...@xerces.apache.org>
Subject: Re: Building under Windows with MinGW
> Hi,
>
> Bidski <bi...@bigpond.net.au> writes:
>
>> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1
>> under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or
>> CygWin, just Windows and MinGW.
>
> You will need to get one of those (CygWin is probably easier). Then
> follow build instructions from the Xerces-C++ website.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis
> http://codesynthesis.com/~boris/blog
> Open-source XML data binding for C++
> http://codesynthesis.com/products/xsd
> XML data binding for embedded systems
> http://codesynthesis.com/products/xsde
> Command line interface to C++ compiler
> http://codesynthesis.com/projects/cli
>
Re: Building under Windows with MinGW
Posted by Bidski <bi...@bigpond.net.au>.
Ok, got it compiled under CygWin using the -mno-cygwin argument and have
linked with the new dll and all of the undefined references have gone but i
still get these 2 warnings
G:/Xerces-c-3.1.1/include/xercesc/util/KVStringPair.hpp:176: warning: 'void
xercesc_3_1::KVStringPair::setKey(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
G:/Xerces-c-3.1.1/include/xercesc/util/KVStringPair.hpp:190: warning: 'void
xercesc_3_1::KVStringPair::setValue(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
Are these anything to be concerned about?
Bidski
--------------------------------------------------
From: "Boris Kolpackov" <bo...@codesynthesis.com>
Sent: Monday, May 24, 2010 11:50 PM
To: <c-...@xerces.apache.org>
Subject: Re: Building under Windows with MinGW
> Hi,
>
> Bidski <bi...@bigpond.net.au> writes:
>
>> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1
>> under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or
>> CygWin, just Windows and MinGW.
>
> You will need to get one of those (CygWin is probably easier). Then
> follow build instructions from the Xerces-C++ website.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis
> http://codesynthesis.com/~boris/blog
> Open-source XML data binding for C++
> http://codesynthesis.com/products/xsd
> XML data binding for embedded systems
> http://codesynthesis.com/products/xsde
> Command line interface to C++ compiler
> http://codesynthesis.com/projects/cli
>
Re: Building under Windows with MinGW
Posted by Lars Uffmann <la...@dlr.de>.
Hey Bidski,
If you are willing to not use CygWin and instead go for MSYS, I'm
willing to work out a good guide together with you. I have successfully
compliled xerces-c both unter CygWin and MSYS (both with MinGW) in the
recent past but decided to go for MSYS because CygWin required an extra
DLL to be distributed along with my executables. I had some extra
problems with MSYS, which I wanted to hammer out when I get some spare
time at work.
If you want to get in touch to work this issue together, with the output
of a step-by-step guide that walks people through compiling from source,
then send me an email.
I'm a bit busy these weeks, but maybe I can fit in some time for this.
Best Regards,
Lars
--
Dipl.-Ing. Lars Uffmann
Microgravity User Support Center (MUSC)
Deutsches Zentrum für Luft- und Raumfahrt e.V.
Linder Höhe
D-51147 Köln
phone: +49 (0)2203 601 2171
http://www.dlr.de/musc
Re: Building under Windows with MinGW
Posted by Bidski <bi...@bigpond.net.au>.
When I first started using this setup I downloaded the xerces-c 3.1.1
pre-compiled binaries for x86_64-windows Visual Studio 10, hoping that they
would be good enough to use with my MinGW/CodeLite setup. Obviously I was
wrong, so I downloaded the xerces-c 3.1.1 source and compiled this under
CygWin with the following as my configure command
./configure CFLAGS=-mno-cygwin
CXXFLAGS=-mno-cygwin --host=x86_64-w64-mingw32 --prefix=/home/Bidski/xerces
LDFLAGS=-no-undefined
If i link to dll file that was created with from the source that I compiled
under CygWin and include the header files from that same source, ld
complains that the dll file is of unrecognizable format. Here is the actual
output from g++.
g++ -o ./Debug/MRP ./Debug/mrp_app.o ./Debug/mrp_frame.o ./Debug/catlist.o
./Debug/inventory.o ./Debug/InventoryXML.o ./Debug/resources.rc.o
"-LC:/wxWidgets/lib/gcc_dll" "-LG:/Xerces/lib" "-L."
"-LC:/wxWidgets/lib/gcc_d"
"-LG:/Xerces/bin" -lxerces-c-3-1 -O2 -mthreads -LC:\wxWidgets\lib\gcc_dll
-lwxmsw28ud -lwxtiffd -lwxjpegd -lwxpngd -lwxzlibd -lwxregexud -lwxexpatd -lkernel32
-luser32 -lgdi32 -lcomdlg32 -lwxregexud -lwinspool -lwinmm -lshell32 -lcomctl32
-lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -mwindows
G:/Xerces/bin/libxerces-c-3-1.dll: file not recognized: File format not
recognized
collect2: ld returned 1 exit status
I decided to mix things up a bit, basically because I was bored and I wanted
to see what would happen. So I used the dll from the source I compiled and
included the header files from the pre-compiled binaries I originally
downloaded, with the result that I get 4 sets of the same 2 warnings.
G:/Xerces/include/xercesc/util/KVStringPair.hpp:176: warning: 'void
xercesc_3_1::KVStringPair::setKey(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
G:/Xerces/include/xercesc/util/KVStringPair.hpp:190: warning: 'void
xercesc_3_1::KVStringPair::setValue(const XMLCh*, XMLSize_t)' redeclared
without dllimport attribute after being referenced with dll linkage
Which is basically the original problem I was having. If I link with the
library in the lib folder (.dll.a?) I get the big list of undefined
references that I mentioned in one of my earlier emails.
If I link with the .dll.a file and use the original pre-compiled binaries
header files I get the warnings and the undefined references, if I link with
the .dll.a file and use the headers from the compiled source I only get the
undefined references.
Can anyone tell me which file im supposed to be linking with? Im assuming
its supposed to be with the dll in the bin folder.
Any can anyone tell me why, when using the headers from my compiled source
ld says that the dll is of unrecognized format?
Thanks
Bidski
--------------------------------------------------
From: "Boris Kolpackov" <bo...@codesynthesis.com>
Sent: Monday, May 24, 2010 11:50 PM
To: <c-...@xerces.apache.org>
Subject: Re: Building under Windows with MinGW
> Hi,
>
> Bidski <bi...@bigpond.net.au> writes:
>
>> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1
>> under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or
>> CygWin, just Windows and MinGW.
>
> You will need to get one of those (CygWin is probably easier). Then
> follow build instructions from the Xerces-C++ website.
>
> Boris
>
> --
> Boris Kolpackov, Code Synthesis
> http://codesynthesis.com/~boris/blog
> Open-source XML data binding for C++
> http://codesynthesis.com/products/xsd
> XML data binding for embedded systems
> http://codesynthesis.com/products/xsde
> Command line interface to C++ compiler
> http://codesynthesis.com/projects/cli
>
Re: Building under Windows with MinGW
Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi,
Bidski <bi...@bigpond.net.au> writes:
> Can anyone provide me with instructions on how to build Xerces-C++ 3.1.1
> under Windows 7 Ultimate 64bit with MinGW 4.4.1. Im not using MSYS or
> CygWin, just Windows and MinGW.
You will need to get one of those (CygWin is probably easier). Then
follow build instructions from the Xerces-C++ website.
Boris
--
Boris Kolpackov, Code Synthesis http://codesynthesis.com/~boris/blog
Open-source XML data binding for C++ http://codesynthesis.com/products/xsd
XML data binding for embedded systems http://codesynthesis.com/products/xsde
Command line interface to C++ compiler http://codesynthesis.com/projects/cli