【问题标题】:build boost c++ with mingw使用 mingw 构建 boost c++
【发布时间】:2013-08-07 17:41:28
【问题描述】:

我在构建 boost c++ 库时是否必须指定cxxflags=-std=c++11?我实际上使用的是 mingw 4.8.0(x32、posix、dwarf,与 Qt 5.1.0 提供的相同)和 boost C++ 1.54.0(所有补丁都在 boost 下载页面中指定)。

【问题讨论】:

  • 如果您希望 Boost 使用可用的 C++11 功能,您应该这样做。

标签: c++ boost c++11 mingw


【解决方案1】:

用于构建我的系统上不需要的 boost 本身(gcc 4.8.1,x64)。我在 Windows 命令提示符(不是 msys)上使用过:

bootstrap mingw

bjam toolset=gcc link=shared variant=debug,release

您也可以使用 b2 (Reference)。不过,您必须在包含路径中有所提升

export CFLAGS="-I/path_to_boost/boost_1_54_0"
export CXXFLAGS="-I/path_to_boost/boost_1_54_0"

对于编译应该使用 C++11 特性的程序,你需要它;如果使用 boost 则独立。

【讨论】:

  • 在 Windows 上 bootstrap mingw 是否等同于 bootstrap gcc
  • 对不起,我不知道。但我猜不会。
猜你喜欢
  • 2014-01-17
  • 1970-01-01
  • 2016-11-01
  • 1970-01-01
  • 2013-12-14
  • 2012-12-08
  • 2019-02-09
  • 2014-09-08
  • 1970-01-01
相关资源
最近更新 更多