【问题标题】:Xerces Link error with Visual Studio 2008Xerces 链接错误与 Visual Studio 2008
【发布时间】:2014-02-20 17:19:24
【问题描述】:

我正在尝试使用 Xerces 编写代码,构建工作正常,但是当涉及到链接时,它失败并出现以下错误:

我正在使用 Visual Studio 2008 Win32 / xerces 3 (xerces-c_3.lib) / 使用多线程 DLL (/MD),我检查“将 wchar_t 视为内置类型”是否设置为是。 ....

你知道我的错误可能在哪里吗?

3>Linking...
3>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static char * __cdecl xercesc_3_1::XMLString::transcode(unsigned short const * const,class xercesc_3_1::MemoryManager * const)" (?transcode@XMLString@xercesc_3_1@@SAPADQBGQAVMemoryManager@2@@Z)
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static char const * const xercesc_3_1::XMLUni::fgXercescDefaultLocale" (?fgXercescDefaultLocale@XMLUni@xercesc_3_1@@2QBDB)
3>signatureinserter.lib(schemeSignatureInserter.obj) : error LNK2001: unresolved external symbol "public: static class xercesc_3_1::MemoryManager * xercesc_3_1::XMLPlatformUtils::fgMemoryManager" (?fgMemoryManager@XMLPlatformUtils@xercesc_3_1@@2PAVMemoryManager@2@A)
fatal error LNK1120: 3 unresolved externals

【问题讨论】:

    标签: c++ visual-studio-2008 linker xerces-c


    【解决方案1】:

    这是一个很老的帖子,但是我遇到了同样的问题。

    解决方案是确保包含平台特定代码:

    #include <xercesc/util/PlatformUtils.hpp>
    

    至少对于当前版本的库 xerces-c-3.1.4,这是定义这些静态成员的位置。

    (不确定转码方法,可能在以前的版本中也包含它?!在我的情况下,我没有遇到问题)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-13
      • 2011-08-26
      • 1970-01-01
      • 1970-01-01
      • 2010-11-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多