【问题标题】:linking qt lib errors链接 qt lib 错误
【发布时间】:2013-03-27 22:14:22
【问题描述】:

我有一个链接问题。我安装了 Visual Studio 2012,下载了 qt-sourcecode 并将其编译为 vc 2012,它与 Visual Studio 插件一起工作正常。然后我下载了 Boost 并编译它。

在控制台应用程序上,Boost 一切正常,但如果我创建一个 qt 项目并想在那里使用 Boost (filesystem libary),我会收到一个链接错误:

error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""void __cdecl boost::filesystem::path_traits::convert(char const *,char const * .......
error LNK2019: Verweis auf nicht aufgelöstes externes Symbol ""public: static class std::codecvt<unsigned short,char,int> const & __cdecl boost::filesystem::path::codecvt(void)......
fatal error LNK1120: 2 nicht aufgelöste Externe

它的英文意思是“未解析的外部符号”..

我使用了相同的包含路径和库路径,但几个小时都无法解决这个问题。 即使我使用 mingw 选项编译 Boost 也不会

有人知道如何解决这个问题吗?

【问题讨论】:

  • 您是否使用选项 '-Zc:wchar_t' 构建 Qt ?

标签: c++ windows boost visual-studio-2012 static-libraries


【解决方案1】:

好的,我想我找到了解决方案,但不是很好。

这有点不同,但它浪费了数小时的搜索时间。最后这个链接解决了这个问题:link to solution。这是第一条评论中的链接。我只需要改变 在 Visual Studio 中:项目属性 -> c/c++ -> 语言 -> 将 wchar_t 视为内置类型:是的。 然后程序将正确链接

【讨论】:

    猜你喜欢
    • 2013-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-16
    • 2020-12-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多