无法获得提升::线程与MSVS2013一起工作

Cant get boost::thread to work with MSVS2013

本文关键字:线程 一起 工作 MSVS2013      更新时间:2023-10-16

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

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

这是我得到的错误:

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:UsersOrDocumentsVisual Studio 2013ProjectsclientclientClient.obj  client

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

这是我的包含代码:

#include <boostthread.hpp>
#define BOOST_ALL_DYN_LINK

我已经在VS开发人员cmd中使用以下命令构建了库:

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

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

我在这里有点迷茫,我尝试使用本指南从头开始构建整个提升:

如何在Visual Studio 2010中使用Boost

仍然没有帮助。

任何帮助将不胜感激。

谢谢

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

从我的计算机上删除了所有提升痕迹。

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

  1. 转到使用 VS 开发人员命令行工具的提升目录
  2. 快捷方式
  3. bootstrap
  4. b2

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

  7. 使用#define BOOST_ALL_DYN_LINK