c++ - boost::future does not compile

标签 c++ boost compiler-errors

尝试编译使用Boost库的项目时遇到问题。
我得到的错误是:

1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(156): error C3646: 'policy_': unknown override specifier
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(156): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(396): error C2061: syntax error: identifier 'wait_until'
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(414): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(421): error C2988: unrecognizable template declaration/definition
1>f:\server\packages\boost.1.60.0.0\lib\native\include\boost\thread\future.hpp(421): error C2059: syntax error: 'this'
以及更多关于future.hpp .....的编译错误
我试图重新安装Windows SDK和Visual Studio,但在两种情况下都没有帮助。
我以为可能是错误的包含路径,所以我检查了项目属性中的宏。我发现在“包含目录”中,我有$(VC_IncludePath); $(WindowsSDK_IncludePath);
评估结果为:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\atlmfc\include C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\shared C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\winrt C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6\Include\um


在上面的第一个路径中,我有文件'future'...
我正在使用:
  • Visual Studio 15的
  • Windows 10 SDK版本10.0.10240.0
  • boost库版本1.60.0.0

  • 应该注意的是,同一项目正在向我的队友编译,因此它可能与设置或包含内容有关,而与代码本身无关。

    最佳答案

    因此,问题在于我计算机上的boost软件包已损坏。
    将其重新安装到项目中(通过视觉效果)并没有帮助,因为它只是从我计算机上的缓存(C:\ Users \ ofir \ .nuget \ packages \ boost)中获取的,而并非真正从Internet下载的。
    我的问题是缓存已损坏-由于某种原因,文件未正确下载。
    解决方案是更新计算机上的软件包:
    为此,我删除了文件夹C:\ Users \ ofir \ .nuget \ packages \ boost \ 1.60.0并重建了我的项目-它重新下载了软件包。
    您还可以使用命令-
    https://docs.microsoft.com/en-us/nuget/consume-packages/reinstalling-and-updating-packages

    关于c++ - boost::future does not compile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64991792/

    相关文章:

    c++ - shared_ptr - 按值传递与按引用传递

    python - 你如何在 boost::python 中使用 "from __future__ import division"?

    c++ - boost::iterator_adapter 不适用于 STL 算法

    c++ - 这个模板程序有什么问题?

    c++ - move_iterator 对于返回纯右值的迭代器被破坏并返回悬空引用

    c++ - 参数不是类或枚举的重载运算符

    c++ - 如何将字符保存到字符数组中

    c++ - 使用未声明的标识符 'MAP_POPULATE'

    compiler-errors - 第一次使用VHDL/MODELSIM : can't compile component [(vcom-1576) expecting END.]

    java - float 的快捷方式赋值和普通赋值的行为