I had followed the following suggestions that seem to take care of the linking errors:
step 1: Add xerces-c_2D.lib (for debug builds) to the list of libraries used in the link phase (right click on the project file, choose Properties, expand the Linker subtree, pick Input, look at the 'Additional Dependencies' field) step 2: - right click on the project entry in the "Solution Explorer" and select "Properties" - click on the C++ folder on the left, then on the "Preprocessor" entry - click on the "Preprocessor Definitions", then on the [...] button - add the macro XML_LIBRARY to the list - click OK to close the macro definition dialog - click OK to close the properties dialog E V K wrote: > > Thanks so much Alberto for your advice. No more wchar_t errors; however, > I get the following linking errors now (while compiling DOMCount.cpp - the > sample): > > Linking... > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static char * __cdecl > xercesc_2_7::XMLString::transcode(unsigned short const * const)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]) referenced in > function "public: __thiscall StrX::StrX(unsigned short const * const)" > (??0StrX@@[EMAIL PROTECTED]@Z) > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static void __cdecl > xercesc_2_7::XMLString::release(char * *)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]) referenced in function > "public: __thiscall StrX::~StrX(void)" (??1StrX@@[EMAIL PROTECTED]) > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) const xercesc_2_7::DOMErrorHandler::`vftable'" > ([EMAIL PROTECTED]@@6B@) referenced in function > "public: virtual __thiscall > DOMCountErrorHandler::~DOMCountErrorHandler(void)" > (??1DOMCountErrorHandler@@[EMAIL PROTECTED]) > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static void __cdecl > xercesc_2_7::XMLPlatformUtils::Terminate(void)" > ([EMAIL PROTECTED]@xercesc_2_7@@SAXXZ) referenced in > function __catch$_main$2 > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static bool __cdecl > xercesc_2_7::DOMImplementation::loadDOMExceptionMsg(enum > xercesc_2_7::DOMException::ExceptionCode,unsigned short * const,unsigned > int)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@Z) > referenced in function __catch$_main$2 > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned long __cdecl > xercesc_2_7::XMLPlatformUtils::getCurrentMillis(void)" > ([EMAIL PROTECTED]@xercesc_2_7@@SAKXZ) referenced > in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgDOMDatatypeNormalization" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced > in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgDOMValidation" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced in function > _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgDOMValidateIfSchema" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced in > function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgXercesSchemaFullChecking" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced > in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgXercesSchema" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced in function > _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static unsigned short const * const > xercesc_2_7::XMLUni::fgDOMNamespaces" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBGB) referenced in function > _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static class xercesc_2_7::DOMImplementation > * __cdecl > xercesc_2_7::DOMImplementationRegistry::getDOMImplementation(unsigned > short const *)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]) > referenced in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static void __cdecl > xercesc_2_7::XMLPlatformUtils::recognizeNEL(bool,class > xercesc_2_7::MemoryManager * const)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@@Z) > referenced in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static class xercesc_2_7::MemoryManager * > xercesc_2_7::XMLPlatformUtils::fgMemoryManager" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@A) > referenced in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static void __cdecl > xercesc_2_7::XMLPlatformUtils::Initialize(char const * const,char const * > const,class xercesc_2_7::PanicHandler * const,class > xercesc_2_7::MemoryManager * const,bool)" > ([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL > PROTECTED]) > referenced in function _main > DOMCount.obj : error LNK2019: unresolved external symbol > "__declspec(dllimport) public: static char const * const > xercesc_2_7::XMLUni::fgXercescDefaultLocale" > ([EMAIL PROTECTED]@xercesc_2_7@@2QBDB) referenced in > function _main > C:\Documents and Settings\ekochetk\My Documents\Visual Studio > 2005\Projects\Test3\Debug\Test3.exe : fatal error LNK1120: 17 unresolved > externals > Build log was saved at "file://c:\Documents and Settings\ekochetk\My > Documents\Visual Studio 2005\Projects\Test3\Test3\Debug\BuildLog.htm" > Test3 - 18 error(s), 0 warning(s) > > > > > I also get the following error in XMLString.cpp (among numerous warnings): > > ..\..\..\..\..\..\..\Program Files\Microsoft Visual > Studio\xerces-c-src_2_7_0\src\xercesc\util\XMLString.cpp(65) : error > C2491: 'xercesc_2_7::XMLString::fgMemoryManager' : definition of dllimport > static data member not allowed > > > Alberto Massari wrote: >> >> EVK, >> it looks your setting for "treat wchar_t as a built-in type" is >> different in the XercesLib and DOMCount project: make them equal. >> >> Alberto >> >> At 15.41 16/03/2007 -0700, E V K wrote: >> >>>Hi I am a novice to both VC++ 8.0 and Xerces 2_7_0. I had followed >>>suggestions on different posts, but they don't seem to take care of the >>>problems I have. >>> >>>When I try to Compile one of the samples: DOMCount.cpp >>> >>>I get link errors >>> >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static char * __cdecl >>>xercesc_2_7::XMLString::transcode(wchar_t const * const)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]) referenced in function >>>"public: __thiscall StrX::StrX(wchar_t const * const)" (??0StrX@@[EMAIL PROTECTED]@Z) >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static void __cdecl >>>xercesc_2_7::XMLString::release(char * *)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]) referenced in function >>>"public: __thiscall StrX::~StrX(void)" (??1StrX@@[EMAIL PROTECTED]) >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) const xercesc_2_7::DOMErrorHandler::`vftable'" >>>([EMAIL PROTECTED]@@6B@) referenced in function "public: >>>virtual __thiscall DOMCountErrorHandler::~DOMCountErrorHandler(void)" >>>(??1DOMCountErrorHandler@@[EMAIL PROTECTED]) >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static void __cdecl >>>xercesc_2_7::XMLPlatformUtils::Terminate(void)" >>>([EMAIL PROTECTED]@xercesc_2_7@@SAXXZ) referenced in >>>function __catch$_main$2 >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static bool __cdecl >>>xercesc_2_7::DOMImplementation::loadDOMExceptionMsg(enum >>>xercesc_2_7::DOMException::ExceptionCode,wchar_t * const,unsigned int)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@Z) >>>referenced in function __catch$_main$2 >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static unsigned long __cdecl >>>xercesc_2_7::XMLPlatformUtils::getCurrentMillis(void)" >>>([EMAIL PROTECTED]@xercesc_2_7@@SAKXZ) referenced in >>>function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgDOMDatatypeNormalization" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in >>>function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgDOMValidation" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in function >>>_main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgDOMValidateIfSchema" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in >>>function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgXercesSchemaFullChecking" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in >>>function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgXercesSchema" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in function >>>_main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static wchar_t const * const >>>xercesc_2_7::XMLUni::fgDOMNamespaces" >>>([EMAIL PROTECTED]@xercesc_2_7@@2QB_WB) referenced in function >>>_main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static class xercesc_2_7::DOMImplementation * >>>__cdecl xercesc_2_7::DOMImplementationRegistry::getDOMImplementation(wchar_t >>>const *)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]) >>>referenced in function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static void __cdecl >>>xercesc_2_7::XMLPlatformUtils::recognizeNEL(bool,class >>>xercesc_2_7::MemoryManager * const)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@@Z) >>>referenced in function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static class xercesc_2_7::MemoryManager * >>>xercesc_2_7::XMLPlatformUtils::fgMemoryManager" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@A) >>>referenced in function _main >>>DOMCount.obj : error LNK2019: unresolved external symbol >>>"__declspec(dllimport) public: static void __cdecl >>>xercesc_2_7::XMLPlatformUtils::Initialize(char const * const,char const * >>>const,class xercesc_2_7::PanicHandler * const,class >>>xercesc_2_7::MemoryManager * const,bool)" >>>([EMAIL PROTECTED]@xercesc_2_7@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL >>>PROTECTED]) >>>referenced in function _main >>> >>>When I compile XMLString.cpp I get a compile error: >>>..\..\..\..\..\..\..\Program Files\Microsoft Visual >>>Studio\xerces-c-src_2_7_0\src\xercesc\util\XMLString.cpp(65) : error C2491: >>>'xercesc_2_7::XMLString::fgMemoryManager' : definition of dllimport static >>>data member not allowed >>> >>>I had added to Tools-> Options: VC++ Directories >>> >>>Include Files: >>>C:\Program Files\Microsoft Visual Studio\xerces-c-src_2_7_0\src >>><xercesdir>\include >>> >>>Library Files: >>>C:\Program Files\Microsoft Visual >>>Studio\xerces-c-src_2_7_0\Build\Win32\VC7.1\Debug >>><xercesdir>\lib >>> >>>Thanks so mush in advance, >>>E V K >>> >>>-- >>>View this message in context: >>>http://www.nabble.com/VC%2B%2B-8.0-Xerces-Linking-Errors-tf3417212.html#a9523780 >>>Sent from the Xerces - C - Users mailing list archive at Nabble.com. >> >> >> > > -- View this message in context: http://www.nabble.com/VC%2B%2B-8.0-Xerces-Linking-Errors-tf3417212.html#a9741204 Sent from the Xerces - C - Users mailing list archive at Nabble.com.
