Boost on Visual Studio 2019

Jeison C. | Dec 25, 2019 min read

Build b2

Run bootstrap.bat

Build the Boost_1_72_0 libraries for MS Visual Studio 2019. The tool set seems to be 14.2, although it seems not necessary to modify the file project-config.jam.

Leaving that file “as is” and using the “developer command prompt to MS 2019” to build the libraries (in my case):

32 bits libraries:

b2 release debug threading=multi --build-type=complete --toolset=msvc stage

64 bits libraries:

b2 release debug threading=multi --build-type=complete --toolset=msvc address-model=64 stage

The builder automatically generates libraries for msvc-14.2 in both versions, debug and release.

b2.exe link=shared,static runtime-link=shared,static release debug threading=multi --build-type=complete --toolset=msvc address-model=64 stage

In order to allow CMake to find all the appropriate files, I had to add the following three system variables:

BOOST_INCLUDEDIR    C:\Libraries\boost_1_72_0\
BOOST_LIBRARYDIR    C:\Libraries\boost_1_72_0\stage\lib
BOOST_ROOT          C:\Libraries\boost_1_72_0\boost