Xerces tips

From Code Synthesis Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 14:42, 10 October 2006
Boris (Talk | contribs)
(Start a page on Xerces-C++ tips)
← Previous diff
Revision as of 14:45, 1 January 2007
Boris (Talk | contribs)
(Add a link to the "Cache and serialize XML Schemas with Xerces-C++" article)
Next diff →
Line 7: Line 7:
* Define the XML_LIBRARY preprocessor symbol while building your application (Project->Properties->C/C++/Preprocessor/Preprocessor_Definitions). If you do not do this then the Xerces-C++ headers will think you are linking against DLL (the default) and will add <code>__declspec (dllimport)</code> to all symbols. This will result in a lot of unresolved symbols during linking. * Define the XML_LIBRARY preprocessor symbol while building your application (Project->Properties->C/C++/Preprocessor/Preprocessor_Definitions). If you do not do this then the Xerces-C++ headers will think you are linking against DLL (the default) and will add <code>__declspec (dllimport)</code> to all symbols. This will result in a lot of unresolved symbols during linking.
* If you build Xerces-C++ with the network support (the default) then you will need to link to the <code>ws2_32.lib</code> library (Winsock2). You can add it into the Project->Properties->Linker->Input->Additional_Dependecies field. * If you build Xerces-C++ with the network support (the default) then you will need to link to the <code>ws2_32.lib</code> library (Winsock2). You can add it into the Project->Properties->Linker->Input->Additional_Dependecies field.
 +
 +== See also ==
 +* [http://www-128.ibm.com/developerworks/webservices/library/x-xsdxerc.html Cache and serialize XML Schemas with Xerces-C++]

Revision as of 14:45, 1 January 2007

This page contains tips on using Xerces-C++ in various non-standard situations.

Linking statically on Windows with VC++ 7.1 and 8

Xerces-C++ 2.7.0 comes with project files that can build static libraries. There are two things you will need to do in order to successfully link such static libraries to your application:

  • Define the XML_LIBRARY preprocessor symbol while building your application (Project->Properties->C/C++/Preprocessor/Preprocessor_Definitions). If you do not do this then the Xerces-C++ headers will think you are linking against DLL (the default) and will add __declspec (dllimport) to all symbols. This will result in a lot of unresolved symbols during linking.
  • If you build Xerces-C++ with the network support (the default) then you will need to link to the ws2_32.lib library (Winsock2). You can add it into the Project->Properties->Linker->Input->Additional_Dependecies field.

See also

Personal tools