简体   繁体   English

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

[英]Unable to link xerces2_7.dll with 64 bit application

Hi I am trying to upgrade project which is already build in 32 bit to 64 bit on windows 7. I have this xerces 2_7 dlls used in the application so I downloaded the source code for xerces2_7_0 version and build the libraries in 64 bit. 嗨,我正在尝试将Windows 7上已经以32位构建的项目升级到64位。我在应用程序中使用了xerces 2_7 dll,因此我下载了xerces2_7_0版本的源代码并以64位构建库。 No problem till here. 到这里没问题。 But when I try to hook this libraries to my project by it throws linker errors. 但是,当我尝试将此库挂接到我的项目时,会引发链接器错误。 below are the errors 以下是错误

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 

So I doubted if I really built this xerces 2_7_0 in 64 bit and wrote test project a 64 bit console application and tried to hook this xerces libraries and able to successfully build the project (used the same set of calls I am making in my project) 因此,我怀疑我是否真的用64位构建了xerces 2_7_0并编写了一个测试项目,并编写了一个64位控制台应用程序,并试图挂钩该xerces库并能够成功构建该项目(使用了我在项目中所做的同一组调用)

I used dependency walker to check all the dependencies; 我使用了依赖项遍历器来检查所有依赖项; When I tried dependency walker on on my 64 bit xerces dll I found errors in opening the file, below are the errors: 当我在我的64位xerces dll上尝试使用依赖行者时,发现打开文件时出现错误,以下是错误:

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.

Any ideas what I am doing wrong and why it did not complain anything with my 64 bit test application. 任何想法,我在做什么错,以及为什么我的64位测试应用程序都没有抱怨。 By the way I am using Visual Studio 2008. Thanks 顺便说一句,我正在使用Visual Studio2008。谢谢

Update 1: Okay here I reduced dependency walker errors to 2 Update 1:好的,在这里我将依赖行者错误减少到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.

The other 2 errors are because of dependency walker I am using was 32 bit executable. 其他两个错误是由于我使用的依赖行者是32位可执行文件。 Now I am using 64 bit dependency walker, but still I see 2 errors. 现在,我正在使用64位依赖项遍历器,但仍然看到2个错误。

Update 2: I got rid of the 2 errors by changing CRT to /MT. Update 2:通过将CRT更改为/ MT,我摆脱了2个错误。 But still I am not able to link this library with my project. 但是我仍然无法将此库与我的项目链接。

I figured it out. 我想到了。 It was the problem with language settings. 这是语言设置的问题。 Under Configuration Properties -> C/C++ -> Language , Treat wchar_t as Built in Type was set to No in my project, where as I am building xerces library with option set to yes. 在我的项目中,在Configuration Properties -> C/C++ -> LanguageTreat wchar_t as Built in Type设置为No ,这是因为我在构建xerces库时将选项设置为yes。

that made the difference. 有所作为。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM