[xsd-users] Re: Problem with XSD (linking with static xercesc library)

Boris Kolpackov boris at codesynthesis.com
Mon Apr 13 09:59:17 EDT 2009


Hi,

In the future please send technical questions like these to the
xsd-users mailing list (which I've CC'ed) instead of to me directly.
This way other developers who may have experienced a similar problem
can provide you with a solution. Plus questions and answers will be
archived and available to others with similar problems.

zanneo <zanneo at mail.ru> writes:

> I've problem with using static xercesc library (2.8 and 3.0). VC++ 2008 
> shows (linking):
> 
> test.obj : error LNK2019: unresolved external symbol 
> "__declspec(dllimport) public: virtual __thiscall 
> xercesc_2_8::Wrapper4InputSource::~Wrapper4InputSource(void)" 
> (__imp_??1Wrapper4InputSource at xercesc_2_8@@UAE at XZ) referenced in 
> function "struct xsd::cxx::xml::dom::auto_ptr<class 
> xercesc_2_8::DOMDocument> __cdecl xsd::cxx::xml::dom::parse<char>(class 
> xercesc_2_8::InputSource &,class xercesc_2_8::DOMErrorHandler &,class 
> xsd::cxx::xml::properties<char> const &,unsigned long)" 
> (??$parse at D@dom at xml@cxx at xsd@@YA?AU?$auto_ptr at VDOMDocument@xercesc_2_8@@@0123 at AAVInputSource@xercesc_2_8@@AAVDOMErrorHandler at 6@ABV?$properties at D@123 at K@Z)
>
> [...] 
>
> 
> How can I resolve this problem? Please, help me.
> P.S. when I use dynamic xercesc library (2.8 and 3.0) - it is normal 
> linking and running.

For 2.8.0 you need to compile your application code (including the
generated code) with the XML_LIBRARY preprocessor define as instructed
in the documentation[1]. For 3.0.x this symbols is called 
XERCES_STATIC_LIBRARY[2]. The easiest way to achieve this is to add one
of these defines to the VC++ project settings.


[1] http://xerces.apache.org/xerces-c/build-winunix-2.html#WinNT

[2] http://xerces.apache.org/xerces-c/build-3.html#Windows

Boris




More information about the xsd-users mailing list