- Extract downloaded boost source, e.g.
C:\Program Files\boost_1_59_0
. - Create a folder for Boost.Build installation, e.g.
C:\Program Files\boost-build
. - Create a folder within for building, i.e.
C:\Program Files\boost_1_59_0\build
. - Create a folder for installation, e.g.
C:\Program Files\boost
.
- Open Command Prompt.
- Run
g++ --version
. - If the output contains g++ version number then GCC should be set up properly to run from command line and you can continue.
- Open Command Prompt and navigate to
C:\Program Files\boost_1_59_0\tools\build
. - Run
bootstrap.bat mingw
. - Run
b2 install --prefix="C:\Program Files\boost-build"
. - Add
C:\Program Files\boost-build\bin
to Windows PATH.
- Open Command Prompt and navigate to
C:\Program Files\boost_1_59_0
. - Run
b2 --build-dir="C:\Program Files\boost_1_59_0\build" --prefix="C:\Program Files\boost" toolset=gcc install
- Add include folder, i.e.
C:\Program Files\boost\include\boost-1_59
. - Add linker folder, i.e.
C:\Program Files\boost\lib
. - Link required libraries, e.g.
libboost_regex-mgw48-mt-1_59.a
.
I looked into the mingw argument for bootstrap.bat. The mingw section of tools\build\src\engine\config_toolset.bat for Boost 1.66.0 looks like
if NOT "_%BOOST_JAM_TOOLSET%_" == "_mingw_" goto Skip_MINGW
if not "_%BOOST_JAM_TOOLSET_ROOT%_" == "__" (
set "PATH=%BOOST_JAM_TOOLSET_ROOT%bin;%PATH%"
)
set "BOOST_JAM_CC=gcc -DNT"
set "BOOST_JAM_OPT_JAM=-o bootstrap\jam0.exe"
set "BOOST_JAM_OPT_MKJAMBASE=-o bootstrap\mkjambase0.exe"
set "BOOST_JAM_OPT_YYACC=-o bootstrap\yyacc0.exe"
set "_known_=1"
:Skip_MINGW
It is the same as for "gcc" except at the beginning it adds
%BOOST_JAM_TOOLSET_ROOT%bin
to the front of PATH if the variable is defined. This is a convenient thing to do if you want to specify which gcc to use, or if you don't want gcc in your system PATH.The problem is that the batch needs to
set "BOOST_JAM_TOOLSET=gcc"
to call the jam0 command with--toolset=gcc
sincetoolset=mingw
is not supported.So my understanding is:
if gcc is in your PATH, just use "bootstrap.bat gcc",
if you want to define
BOOST_JAM_TOOLSET_ROOT
to specify a bin subfolder containing the gcc you want to use, then add the missing lineset "BOOST_JAM_TOOLSET=gcc"
to the mingw section of bootstrap.bat and use "bootstrap.bat mingw".