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)"
> (__imp_?transcode@XMLString@xercesc_2_7@@SAPADQBG@Z) referenced in
> function "public: __thiscall StrX::StrX(unsigned short const * const)"
> (??0StrX@@QAE@QBG@Z)
> DOMCount.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static void __cdecl
> xercesc_2_7::XMLString::release(char * *)"
> (__imp_?release@XMLString@xercesc_2_7@@SAXPAPAD@Z) referenced in function
> "public: __thiscall StrX::~StrX(void)" (??1StrX@@QAE@XZ)
> DOMCount.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) const xercesc_2_7::DOMErrorHandler::`vftable'"
> (__imp_??_7DOMErrorHandler@xercesc_2_7@@6B@) referenced in function
> "public: virtual __thiscall
> DOMCountErrorHandler::~DOMCountErrorHandler(void)"
> (??1DOMCountErrorHandler@@UAE@XZ)
> DOMCount.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static void __cdecl
> xercesc_2_7::XMLPlatformUtils::Terminate(void)"
> (__imp_?Terminate@XMLPlatformUtils@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)"
> (__imp_?loadDOMExceptionMsg@DOMImplementation@xercesc_2_7@@SA_NW4ExceptionCode@DOMException@2@QAGI@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)"
> (__imp_?getCurrentMillis@XMLPlatformUtils@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"
> (__imp_?fgDOMDatatypeNormalization@XMLUni@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"
> (__imp_?fgDOMValidation@XMLUni@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"
> (__imp_?fgDOMValidateIfSchema@XMLUni@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"
> (__imp_?fgXercesSchemaFullChecking@XMLUni@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"
> (__imp_?fgXercesSchema@XMLUni@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"
> (__imp_?fgDOMNamespaces@XMLUni@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 *)"
> (__imp_?getDOMImplementation@DOMImplementationRegistry@xercesc_2_7@@SAPAVDOMImplementation@2@PBG@Z)
> 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)"
> (__imp_?recognizeNEL@XMLPlatformUtils@xercesc_2_7@@SAX_NQAVMemoryManager@2@@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"
> (__imp_?fgMemoryManager@XMLPlatformUtils@xercesc_2_7@@2PAVMemoryManager@2@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)"
> (__imp_?Initialize@XMLPlatformUtils@xercesc_2_7@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@_N@Z)
> referenced in function _main
> DOMCount.obj : error LNK2019: unresolved external symbol
> "__declspec(dllimport) public: static char const * const
> xercesc_2_7::XMLUni::fgXercescDefaultLocale"
> (__imp_?fgXercescDefaultLocale@XMLUni@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)"
>>>(__imp_?transcode@XMLString@xercesc_2_7@@SAPADQB_W@Z) referenced in
function
>>>"public: __thiscall StrX::StrX(wchar_t const * const)"
(??0StrX@@QAE@QB_W@Z)
>>>DOMCount.obj : error LNK2019: unresolved external symbol
>>>"__declspec(dllimport) public: static void __cdecl
>>>xercesc_2_7::XMLString::release(char * *)"
>>>(__imp_?release@XMLString@xercesc_2_7@@SAXPAPAD@Z) referenced in function
>>>"public: __thiscall StrX::~StrX(void)" (??1StrX@@QAE@XZ)
>>>DOMCount.obj : error LNK2019: unresolved external symbol
>>>"__declspec(dllimport) const xercesc_2_7::DOMErrorHandler::`vftable'"
>>>(__imp_??_7DOMErrorHandler@xercesc_2_7@@6B@) referenced in function
"public:
>>>virtual __thiscall DOMCountErrorHandler::~DOMCountErrorHandler(void)"
>>>(??1DOMCountErrorHandler@@UAE@XZ)
>>>DOMCount.obj : error LNK2019: unresolved external symbol
>>>"__declspec(dllimport) public: static void __cdecl
>>>xercesc_2_7::XMLPlatformUtils::Terminate(void)"
>>>(__imp_?Terminate@XMLPlatformUtils@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)"
>>>(__imp_?loadDOMExceptionMsg@DOMImplementation@xercesc_2_7@@SA_NW4ExceptionCode@DOMException@2@QA_WI@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)"
>>>(__imp_?getCurrentMillis@XMLPlatformUtils@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"
>>>(__imp_?fgDOMDatatypeNormalization@XMLUni@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"
>>>(__imp_?fgDOMValidation@XMLUni@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"
>>>(__imp_?fgDOMValidateIfSchema@XMLUni@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"
>>>(__imp_?fgXercesSchemaFullChecking@XMLUni@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"
>>>(__imp_?fgXercesSchema@XMLUni@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"
>>>(__imp_?fgDOMNamespaces@XMLUni@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 *)"
>>>(__imp_?getDOMImplementation@DOMImplementationRegistry@xercesc_2_7@@SAPAVDOMImplementation@2@PB_W@Z)
>>>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)"
>>>(__imp_?recognizeNEL@XMLPlatformUtils@xercesc_2_7@@SAX_NQAVMemoryManager@2@@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"
>>>(__imp_?fgMemoryManager@XMLPlatformUtils@xercesc_2_7@@2PAVMemoryManager@2@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)"
>>>(__imp_?Initialize@XMLPlatformUtils@xercesc_2_7@@SAXQBD0QAVPanicHandler@2@QAVMemoryManager@2@_N@Z)
>>>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.
|