alexbuisson
alexbuisson

Reputation: 8469

Xerces Link error with Visual Studio 2008

I'm trying to write a code using Xerces, the build worked fine, but when it comes to the link, it fails with the following error:

I'm using Visual Studio 2008 Win32 / with xerces 3 (xerces-c_3.lib) / using Multi-threaded DLL (/MD) and i check that "treat wchar_t as built-in type" is set to yes.....

Have you an idea of where my error could be ?

3>Linking...
3>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static char * __cdecl xercesc_3_1::XMLString::transcode(unsigned short const * const,class xercesc_3_1::MemoryManager * const)" (?transcode@XMLString@xercesc_3_1@@SAPADQBGQAVMemoryManager@2@@Z)
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static char const * const xercesc_3_1::XMLUni::fgXercescDefaultLocale" (?fgXercescDefaultLocale@XMLUni@xercesc_3_1@@2QBDB)
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static class xercesc_3_1::MemoryManager * xercesc_3_1::XMLPlatformUtils::fgMemoryManager" (?fgMemoryManager@XMLPlatformUtils@xercesc_3_1@@2PAVMemoryManager@2@A)
fatal error LNK1120: 3 unresolved externals

Upvotes: 1

Views: 858

Answers (1)

Henrique Evaristo
Henrique Evaristo

Reputation: 1

This is a pretty old thread however I came across the same issue.

The solution is to make sure you include the Platform specific code:

#include <xercesc/util/PlatformUtils.hpp>

At least for the current version of the library, xerces-c-3.1.4, this is where those static members are defined.

(not sure about transcode method, possibly in previous versions it was also included there?! In my situation I did not had issues with it)

Upvotes: 0

Related Questions