Build Boost

Building Boost 1.83 with Visual Studio 2022 (static link, multithreading)

For Windows

cd C:\boost_1_83_0\
bootstrap.bat
b2 -j8 toolset=msvc-14.3 variant=debug link=static threading=multi runtime-link=shared
b2 -j8 toolset=msvc-14.3 variant=debug link=static threading=multi runtime-link=static
b2 -j8 toolset=msvc-14.3 variant=release link=static threading=multi runtime-link=shared
b2 -j8 toolset=msvc-14.3 variant=release link=static threading=multi runtime-link=static

For WSL

wget https://boostorg.jfrog.io/artifactory/main/release/1.83.0/source/boost_1_83_0.tar.gz
tar vxzf boost_1_83_0.tar.gz
cd ./boost_1_83_0
./bootstrap.sh
sudo ./b2 link=static threading=multi install

Output

Directory

C:\boost_1_83_0\stage\lib

Static debug shared runtime

libboost_atomic-vc143-mt-gd-x32-1_83.lib
libboost_atomic-vc143-mt-gd-x64-1_83.lib
...

Static debug static runtime

libboost_atomic-vc143-mt-sgd-x32-1_83.lib
libboost_atomic-vc143-mt-sgd-x64-1_83.lib
...

Static release shared runtime

libboost_atomic-vc143-mt-x32-1_83.lib
libboost_atomic-vc143-mt-x64-1_83.lib
...

Static release static runtime

libboost_atomic-vc143-mt-s-x32-1_83.lib
libboost_atomic-vc143-mt-s-x64-1_83.lib
...

Environment Variables (Windows)

Name Value
BOOST_INCLUDEDIR C:\boost_1_83_0
BOOST_LIBRARYDIR C:\boost_1_83_0\stage\lib
BOOST_ROOT C:\boost_1_83_0
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)

find_package(Boost COMPONENTS thread chrono regex REQUIRED )

include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})