Question

I am new to Xercesc. I have included the xerces static lib xerces-c_static_3D.lib in my Project properties->linker additional libraries. Everything else using xerces works fine but when I add this line,

XMLCh* paramStr = XMLString::transcode("param");

I am getting the error below. Please let me know why is this happening?

LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short * __cdecl xercesc_3_1::XMLString::transcode(char const * const,class xercesc_3_1::MemoryManager * const)" (__imp_?transcode@XMLString@xercesc_3_1@@SAPAGQBDQAVMemoryManager@2@@Z)

3>a.lib(MetaFileReader.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_3_1::XMLString::release(unsigned short * *,class xercesc_3_1::MemoryManager * const)" (__imp_?release@XMLString@xercesc_3_1@@SAXPAPAGQAVMemoryManager@2@@Z)

3>a.lib(MetaFileReader.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static char * __cdecl xercesc_3_1::XMLString::transcode(unsigned short const * const,class xercesc_3_1::MemoryManager * const)" (__imp_?transcode@XMLString@xercesc_3_1@@SAPADQBGQAVMemoryManager@2@@Z)

Was it helpful?

Solution

IIRC, you need to match some preprocessor flag when you build the Xercesc library with your project setting Treat wchar_t as built-in type. Have a look at the definition of XMLCh in the Xercesc headers to figure out which preprocessor flag. Make sure that your projects that link against the Xercesc library use the same project setting.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top