Since yours is now the third “How do I build boost on Windows?” question that I’ve seen since 1.60.0
was released here are my own personal Windows boost build notes:
Windows does not directly support boost, so you can download it and put it wherever you want.
The boost user guide recommends creating a BOOST_ROOT
environment variable with the location of boost.
Note: in the following examples 2>&1 | tee ??_build.txt
is optional, but it’s useful to keep a build log…
Building for Visual Studio 2015
In a Visual Studio tools Command Prompt:
cd boost_1_xx_0
call bootstrap.bat
For static libraries:
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=complete stage
2>&1 | tee msvc_static_build.txt
Note: thread must be built with dynamic linking see: https://studiofreya.com/2015/05/20/the-simplest-way-of-building-boost-1-58-for-32-bit-and-64-bit-architectures-with-visual-studio/
For dynamic thread library:
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=shared threading=multi runtime-link=shared --with-thread --build-type=minimal stage
2>&1 | tee msvc_thread_build.txt
For all as dynamic libraries:
b2 -j8 toolset=msvc-14.0 address-model=64 architecture=x86 link=shared threading=multi runtime-link=shared --build-type=complete stage
2>&1 | tee msvc_dynamic_build.txt
Building for MinGw
Ensure that gcc/mingw is in the path, e.g.: C:\Qt\Tools\mingw491_32\bin
cd boost_1_xx_0
bootstrap.bat mingw
b2 toolset=gcc link=shared threading=multi --build-type=complete stage
2>&1 | tee mingw_build.txt
Note: since boost 1.61.0
you may need to change: bootstrap.bat mingw
to bootstrap.bat gcc