无法将xerces2_7.dll与64位应用程序链接

时间:2013-03-27 15:56:27

标签: c++ visual-studio-2008 64-bit xerces xerces-c

您好我正在尝试升级已在Windows 7上以32位到64位构建的项目。我在应用程序中使用了xerces 2_7 dll,因此我下载了xerces2_7_0版本的源代码并在64位中构建库。没问题,直到这里。但是当我尝试通过它将这个库挂钩到我的项目时会抛出链接器错误。以下是错误

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@QEAGI@Z) referenced in function "int `private: bool __cdecl 
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_2_7::XMLUni::fgDOMDatatypeNormalization" (__imp_?fgDOMDatatypeNormalization@XMLUni@xercesc_2_7@@2QBGB)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_2_7::XMLUni::fgDOMValidateIfSchema" (__imp_?fgDOMValidateIfSchema@XMLUni@xercesc_2_7@@2QBGB)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_2_7::XMLUni::fgXercesSchemaFullChecking" (__imp_?fgXercesSchemaFullChecking@XMLUni@xercesc_2_7@@2QBGB)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_2_7::XMLUni::fgXercesSchema" (__imp_?fgXercesSchema@XMLUni@xercesc_2_7@@2QBGB)
error LNK2001: unresolved external symbol "__declspec(dllimport) public: static unsigned short const * const xercesc_2_7::XMLUni::fgDOMNamespaces" (__imp_?fgDOMNamespaces@XMLUni@xercesc_2_7@@2QBGB)
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@@SAPEAVDOMImplementation@2@PEBG@Z) referenced in function "private: bool __cdecl 

所以我怀疑我是否真的在64位中构建了这个xerces 2_7_0并将测试项目编写为64位控制台应用程序并试图挂钩这个xerces库并能够成功构建项目(使用我正在制作的同一组调用我的项目)

我使用依赖walker来检查所有依赖项; 当我在64位xerces dll上尝试依赖walker时,我发现打开文件时出错,下面是错误:

Error: The Side-by-Side configuration information for "c:\users\vivek\desktop\xerces64bit\x64\debug\XERCES64BIT.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail (14001).
Error: At least one required implicit or forwarded dependency was not found.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.

任何想法我做错了以及为什么它没有抱怨我的64位测试应用程序。顺便说一下,我使用的是Visual Studio 2008。 感谢

Update 1: 好的,我将依赖性walker错误减少到2

Error: The Side-by-Side configuration information for "c:\users\vivek\desktop\xerces64bit\x64\debug\XERCES64BIT.EXE" contains errors. The application has failed to start because its side-by-side configuration is incorrect. Please see the application event log or use the command-line sxstrace.exe tool for more detail (14001).
Error: At least one required implicit or forwarded dependency was not found.

其他2个错误是因为我使用的依赖性walker是32位可执行文件。现在我使用64位依赖性walker,但我仍然看到2个错误。

Update 2: 我通过将CRT更改为/ MT来消除2个错误。但我仍然无法将此库与我的项目链接。

1 个答案:

答案 0 :(得分:0)

我明白了。这是语言设置的问题。在Configuration Properties - > C/C++ - > Language下,Treat wchar_t as Built in Type在我的项目中设置为No,我正在使用选项集构建xerces库是的

这产生了不同。