c++ - 如何与其他 boost 库一起构建 boost::fiber?

标签 c++ boost

我正在尝试构建 boost::fiber与 Ubuntu 上的其他 boost 库一起使用。我从 sourceforge 下载了 boost 版本 1.61| .我从 github 下载了 boost::fiber 1.0 版。我在 boost 分发的 boost/libs 子目录中复制了名为 fiber 的目录。我用于构建的命令是:

sudo ./b2 cxxflags="-std=c++14" --build-type=minimal --build-dir=/home/bobeff/projects/build --layout=system install

使用的g++版本是:

g++ (Ubuntu 5.4.0-6ubuntu1~16.04.2) 5.4.0 20160609

boost::fiber 编译失败,第一个错误是:

gcc.compile.c++ /home/bobeff/projects/build/boost/bin.v2/libs/fiber/build/gcc-5.4.0/release/link-static/threading-multi/algorithm.o
In file included from libs/fiber/src/algorithm.cpp:9:0:
./boost/fiber/fiber_context.hpp:91:5: error: invalid use of template-name ‘boost::context::execution_context’ without an argument list
     context::execution_context                      ctx_;

最佳答案

您是否也使用 C++14 构建了 boost.context? 检查是否支持所有必需的 C++ 功能(lambdas、nullptr 等)。 当您运行 b2/bjam 时,您会在标准输出中看到这一点——也许您必须使用选项 --reconfigure 调用 b2/bjam。 作为替代方案,您可以等到 boost-1.62 发布(2016 年 9 月 28 日?)。

关于c++ - 如何与其他 boost 库一起构建 boost::fiber?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38936748/

相关文章:

c++ - 如何为二维数组编写一个好的GMock匹配器?

c++ - 如何可移植(反)序列化 qint32?

c++ - 在 std::string 和 std::wstring 之间转换的多平台方式

c++ - 如何转换 boost::Exception?

c++ - 如何使用区域增长算法来定义感兴趣区域?

c++ - 在C++中将从文件读取的二进制数据转换为char指针

c++ - 如何 std::find 使用比较对象?

c++ - 在使用 Boost::asio 之前从套接字读取后是否可以执行 async_handshake?

python - 如何在 N 个较小的矩形上拆分一个大矩形以使其看起来随机?

c++ - 涉及 boost::thread 的奇怪崩溃