- 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
.
When running the first b2, no toolset is given. Does this matter for the first build? When run it gives:
warning: No toolsets are configured.
warning: Configuring default toolset "msvc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: http://boost.org/boost-build2/doc/html/bbv2/advanced/configuration.html
warning: Did not find command for MSVC toolset. If you have Visual Studio 2017 installed you will need to specify the full path to the command, set VS150COMNTOOLS for your installation, or build from the 'Visual Studio Command Prompt for VS 2017'.