【问题标题】:Cant get boost::thread to work with MSVS2013无法让 boost::thread 与 MSVS2013 一起使用
【发布时间】:2015-01-18 14:07:29
【问题描述】:

我正在尝试将 Boost:thread 用于我正在开发的简单 http 客户端。

我无法让它工作,我正在使用的所有其他 boost 库都工作正常。

这是我得到的错误:

Error   7   error LNK2019: unresolved external symbol "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Client::add_user(void)" (?add_user@Client@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) referenced in function "public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall Client::commandBuilder(void)" (?commandBuilder@Client@@QAE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)    C:\Users\Or\Documents\Visual Studio 2013\Projects\client\client\Client.obj  client

请注意,我遇到了 8 个非常相似的错误。

这是我的包含代码:

#include <boost\thread.hpp>
#define BOOST_ALL_DYN_LINK

我已经在 VS 开发者 cmd 中使用此命令构建了库:

bjam toolset=msvc-12.0 --build-type=complete --with-thread --with-chrono --with-date_time

我的 VC++ 和链接器的包含路径都设置为正确的路径。

我有点迷路了,我尝试使用本指南从头开始重新构建整个提升:

How to use Boost in Visual Studio 2010

仍然没有帮助。

任何帮助将不胜感激。

谢谢

【问题讨论】:

    标签: c++ multithreading visual-studio boost boost-thread


    【解决方案1】:

    已修复,显然所有建筑物和建筑物都损坏了我的 boost 安装。

    从我的电脑上删除了所有的提升痕迹。

    通过以下步骤重新安装它:

    1. 使用 vs 开发者命令行工具快捷方式进入 boost 目录
    2. bootstrap
    3. b2

    4. bjam toolset=msvc-11.0 --build-type=complete --with-thread --with-chrono --     with-date_time
      
    5. 将所有库重新配置为正确的库。

    6. 使用#define BOOST_ALL_DYN_LINK

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-30
      • 2018-04-14
      • 2014-10-31
      • 2018-01-02
      • 2016-11-14
      • 2015-02-01
      • 2019-05-10
      • 2017-11-20
      相关资源
      最近更新 更多