To compile Boost using g++ -std=c++11
from MinGW, do the following:
- Ensure that MinGW is installed at
C:\MinGW\
- Launch a regular Windows Command Prompt, not a MSys Command Prompt:
cmd
- Ensure that the
PATH
Environment Variable containsC:\MinGW\bin\
:
set PATH=C:\MinGW\bin;%PATH%
- Change directories to Boost:
cd C:\boost_1_54_0\
- Pass in
mingw
tobootstrap.bat
:
bootstrap.bat mingw
- Call
b2.exe
:
b2.exe toolset=gcc cxxflags="-std=c++11" --build-type=complete stage
This will build Boost using the GCC toolset in MinGW with the g++
flags set to -std=c++11
.
NOTE: This post was tested by compiling Boost 1.54.0 ( http://www.boost.org ) with GCC version 4.8.1 from MinGW ( http://www.mingw.org ).
The output from b2.exe
using the flag cxxflags="-std=c++11"
ended with:
...failed updating 156 targets...
...skipped 396 targets...
...updated 4783 targets...
Additionally, only 284 stage\lib
files were built.
However, the output without using that flag ended with:
...failed updating 24 targets...
...skipped 40 targets...
...updated 5271 targets...
Additionally, 428 stage\lib
files were built.
Therefore, not all stage\lib
files are built using the flag cxxflags="-std=c++11"
.