【问题标题】:Can't link boost file system with Qt creator无法将 boost 文件系统与 Qt 创建者链接
【发布时间】:2012-07-15 17:36:05
【问题描述】:

我需要使用 boost 文件系统,但在 windows(cl 2010 express) 下我有一些链接器错误。 我使用 Qt creator 和 qmake 并且不显式链接。我唯一的想法是提供包含和 lib 路径

win32 {

    BOOSTHOME = C:/boost

    INCLUDEPATH += $$BOOSTHOME\\boost_1_47

    LIBS += -L$$BOOSTHOME\\boost_1_47\\lib
}

当我尝试构建时出现此错误:

main.obj:-1: error: LNK2019: unresolved external symbol "private: static class std::codecvt<unsigned short,char,int> const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet(void)" (?wchar_t_codecvt_facet@path@filesystem3@boost@@CAAAPBV?$codecvt@GDH@std@@XZ) referenced in function "public: static class std::codecvt<unsigned short,char,int> const & __cdecl boost::filesystem3::path::codecvt(void)" (?codecvt@path@filesystem3@boost@@SAABV?$codecvt@GDH@std@@XZ)

我还有两个,类似的。 我对 libarchive 有类似的问题,但是当我动态链接时一切都很好 我必须做什么才能正确链接

【问题讨论】:

    标签: boost linker qmake


    【解决方案1】:

    对于windows和msvc 2010编译器必须添加define

    DEFINES += BOOST_ALL_NO_LIB
    

    然后将你的 boost 库链接到

    LIBS += -lyourboostlib
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-09
      • 1970-01-01
      • 2022-10-07
      • 1970-01-01
      相关资源
      最近更新 更多