首页 文章

Xerces:使用XMLString :: transcode时出现链接错误

提问于
浏览
1

我是Xercesc的新手 . 我在项目属性 - >链接器附加库中包含了xerces static lib xerces-c_static_3D.lib . 使用xerces的其他所有工作正常但是当我添加这一行时,

XMLCh * paramStr = XMLString :: transcode(“param”);

我收到以下错误 . 请让我知道为什么会这样?

LNK2001:未解析的外部符号“_declspec(dllimport)public:static unsigned short * cdecl xercesc_3_1 :: XMLString :: transcode(char const * const,class xercesc_3_1 :: MemoryManager * const)”( imp?transcode @ XMLString @ xercesc_3_1 @@ SAPAGQBDQAVMemoryManager @ @@ 2 Z)

3> a.lib(MetaFileReader.obj):错误LNK2001:未解析的外部符号“__declspec(dllimport)public:static void __cdecl xercesc_3_1 :: XMLString :: release(unsigned short * *,class xercesc_3_1 :: MemoryManager * const)”( _imp?发布@了XmlString @ xercesc_3_1 @@ SAXPAPAGQAVMemoryManager @ 2 @@ Z)

3> a.lib(MetaFileReader.obj):错误LNK2001:未解析的外部符号“_declspec(dllimport)public:static char * cdecl xercesc_3_1 :: XMLString :: transcode(unsigned short const * const,class xercesc_3_1 :: MemoryManager * const) “( imp?transcode @ XMLString @ xercesc_3_1 @@ SAPADQBGQAVMemoryManager @ 2 @@ Z)

1 回答

  • 2

    IIRC,当您使用项目设置Treat wchar_t as built-in type构建Xercesc库时,需要匹配一些预处理器标志 . 看一下Xercesc头文件中XMLCh的定义,找出哪个预处理器标志 . 确保链接到Xercesc库的项目使用相同的项目设置 .

相关问题