我正在尝试构建 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/