質問

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. 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)

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:

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. By the way I am using Visual Studio 2008. Thanks

Update 1: Okay here I reduced dependency walker errors to 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. Now I am using 64 bit dependency walker, but still I see 2 errors.

Update 2: I got rid of the 2 errors by changing CRT to /MT. 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.

that made the difference.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top