求熟悉xerces-c++的帮忙
如何在visual studio 2005 上编译一个包含xerces-c++头文件的程序?
类似如下:
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOM.hpp>
遇到的问题如下
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static wchar_t * __cdecl xercesc_2_8::XMLString::transcode(char const * const)" (__imp_?transcode@XMLString@xercesc_2_8@@SAPA_WQBD@Z) referenced in function "public: __thiscall XStr::XStr(char const * const)" (??0XStr@@QAE@QBD@Z)
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_2_8::XMLString::release(wchar_t * *)" (__imp_?release@XMLString@xercesc_2_8@@SAXPAPA_W@Z) referenced in function "public: __thiscall XStr::~XStr(void)" (??1XStr@@QAE@XZ)
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_2_8::XMLString::release(char * *)" (__imp_?release@XMLString@xercesc_2_8@@SAXPAPAD@Z) referenced in function __catch$_main$2
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static char * __cdecl xercesc_2_8::XMLString::transcode(wchar_t const * const)" (__imp_?transcode@XMLString@xercesc_2_8@@SAPADQB_W@Z) referenced in function __catch$_main$2
1>test.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class xercesc_2_8::MemoryManager * xercesc_2_8::XMLPlatformUtils::fgMemoryManager" (__imp_?fgMemoryManager@XMLPlatformUtils@xercesc_2_8@@2PAVMemoryManager@2@A) referenced in function _main
.........
[解决办法]
很可能是没有添加对xerces相关的lib的引用。
[解决办法]
嗯,同意楼上,在link选项中将xerces的lib路径添加进去
[解决办法]
你用xerces生成库的编译环境要跟你写代码时用的编译环境版本是一样的。
比如你用vs2005生成xerces的lib库,你写代码时的编译环境也要是vs2005的