Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我一直在使用 boost.build 或 b2 来构建项目。我正在尝试添加 C++11 之类的结构auto,begin但是带有 Jamfile 的目录中的标准调用b2 release无法识别这些。
auto
begin
b2 release
您需要告诉编译器启用 c++11 支持
例如,对于 gcc,您可以使用
b2 toolset=gcc cxxflags="-std=c++11"
(或相同的命令,bjam而不是b2;它们现在与bjam为向后兼容而保留的相同。)
bjam
b2
在 Jamroot 中添加了以下内容
<toolset>gcc:<cxxflags>-std=gnu++0x <toolset>clang:<cxxflags>-std=c++11
似乎在工作