How to build Boost 1.64 in 64 bits?

To update the answer I gave here. Visual Studio 2017 is a new toolset, so simply replace toolset=msvc-14.0 (for Visual Studio 2015) with toolset=msvc-14.1 i.e.:

In a Visual Studio tools Command Prompt:

cd boost_1_64_0
call bootstrap.bat

For static libraries (recommended for Windows):

b2 -j8 toolset=msvc-14.1 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=complete stage

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/

To build thread in a dynamic library:

b2 -j8 toolset=msvc-14.1 address-model=64 architecture=x86 link=shared threading=multi runtime-link=shared --with-thread --build-type=minimal stage

Note: the correct b2 toolset for Visual Studio 2017 is msvc-14.1 not msvc-15.0 and
the b2 toolset for Visual Studio 2019 is msvc-14.2.
If in doubt (and you’ve only one version of Visual Studio installed) just use toolset=msvc.

Leave a Comment