使用mingw构建boost c++

build boost c++ with mingw

本文关键字:c++ boost 构建 mingw 使用      更新时间:2023-10-16

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

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

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

或者,您可以使用b2(参考)。你必须在你的包含路径中有提升,尽管

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

对于编译应该使用C++11特性的程序,您需要它;独立于是否使用升压。