0

嗨,我正在尝试将已经在 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 库并能够成功构建项目(使用了我在项目中进行的同一组调用)

我使用dependency 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 位依赖遍历器,但我仍然看到 2 个错误。

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

4

1 回答 1

0

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

这有所作为。

于 2013-03-28T20:06:25.260 回答