【问题标题】:Xerces: Link error on using XMLString::transcodeXerces:使用 XMLString::transcode 时出现链接错误
【发布时间】:2014-05-06 06:29:18
【问题描述】:

我是 Xercesc 的新手。我在我的项目属性->链接器附加库中包含了 xerces 静态库 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) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: static void __cdecl xercesc_3_1::XMLString::release(unsigned short * *,class xercesc_3_1::MemoryManager * const )" (__imp_?release@XMLString@xercesc_3_1@@SAXPAPAGQAVMemoryManager@2@@Z)

3>a.lib(MetaFileReader.obj) : error LNK2001: unresolved external symbol "__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)

【问题讨论】:

    标签: c++ xerces


    【解决方案1】:

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

    【讨论】:

    • 酷谢谢!!那行得通。我将 Treat wchar_t as built-in type 设置为 Yes。
    猜你喜欢
    • 1970-01-01
    • 2012-04-07
    • 1970-01-01
    • 1970-01-01
    • 2014-10-05
    • 2021-10-07
    • 2012-09-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多