0

In my project it is crucial I use __stdcall. However, I get this:

1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static void __cdecl xercesc_3_0::XMLString::release(unsigned short * *,class xercesc_3_0::MemoryManager * const)" (?release@XMLString@xercesc_3_0@@SAXPEAPEAGQEAVMemoryManager@2@@Z) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static char * __cdecl xercesc_3_0::XMLString::transcode(unsigned short const * const,class xercesc_3_0::MemoryManager * const)" (?transcode@XMLString@xercesc_3_0@@SAPEADQEBGQEAVMemoryManager@2@@Z) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short * __cdecl xercesc_3_0::XMLString::transcode(char const * const,class xercesc_3_0::MemoryManager * const)" (?transcode@XMLString@xercesc_3_0@@SAPEAGQEBDQEAVMemoryManager@2@@Z) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static char const * const xercesc_3_0::XMLUni::fgXercescDefaultLocale" (?fgXercescDefaultLocale@XMLUni@xercesc_3_0@@2QBDB) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static class xercesc_3_0::MemoryManager * xercesc_3_0::XMLPlatformUtils::fgMemoryManager" (?fgMemoryManager@XMLPlatformUtils@xercesc_3_0@@2PEAVMemoryManager@2@EA) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static class xercesc_3_0::DOMImplementation * __cdecl xercesc_3_0::DOMImplementationRegistry::getDOMImplementation(unsigned short const *)" (?getDOMImplementation@DOMImplementationRegistry@xercesc_3_0@@SAPEAVDOMImplementation@2@PEBG@Z) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short const * const xercesc_3_0::XMLUni::fgDOMWRTFormatPrettyPrint" (?fgDOMWRTFormatPrettyPrint@XMLUni@xercesc_3_0@@2QBGB) 1>ExchangeParser.obj : error LNK2001: unresolved external symbol "public: static unsigned short const * const xercesc_3_0::XMLUni::fgDOMXMLDeclaration" (?fgDOMXMLDeclaration@XMLUni@xercesc_3_0@@2QBGB)

Any help?

hmjd
  • 120,187
  • 20
  • 207
  • 252
puzdrow
  • 1
  • 1
  • 1
  • 2
  • What is your OS? __stdcall is for win32 API see http://stackoverflow.com/questions/297654/what-is-stdcall – EdChum Mar 13 '12 at 09:32

1 Answers1

0

Xerces is open source, so why not just compile your own variant that uses __stdcall as the default convention, then you won't have the linkage errors.

It even comes with projects for every Windows IDE (including MSVC, which it appears you are using), so its merely a matter of loading it up, change one global option and hitting compile (you may need to change some places where __cdecl must be explicitly used, but the compiler will error on these locations when you build it).

Necrolis
  • 25,836
  • 3
  • 63
  • 101
  • I tried compiling using __stdcall, but nevertheless I get same errors. It seems that these methods explicitly use __cdecl convention. Is there any way to bypass this problem in any other way? Thanks – puzdrow Mar 14 '12 at 08:39
  • @user1266041: if these methods explicitly need `__cdecl` and you need to make the definitions in the header(s) explicitly state this via the `__cdecl` function attribute – Necrolis Mar 14 '12 at 09:39