VS2019 安装 boost 1.72

官方教程:<https://www.boost.org/doc/libs/1_72_0/more/getting_started/windows.html#prepare- to-use-a-boost-library-binary>

下载:https://www.boost.org/users/history/version_1_72_0.html

解压后,找到 bootstrap.bat

Windows 菜单里找到 Visual Studio 2019 -> Visual Studio Tools -> VC -> x86_x64 Cross Tools Command Prompt for VS 2019 并打开

切换到安装目录:

1
cd C:\boost_1_72_0

执行

1
.\bootstrap.bat

完毕后同目录会生成 b2.exe

编译 x86(32位)

1
.\b2 toolset=msvc-14.2 link=static runtime-link=static,shared --build-dir=build/x86 address-model=32 -j12 install --includedir=C:\boost_1_72_0\include --libdir=C:\boost_1_72_0\stage\lib\x86  

编译 x86_64(64位)

1
.\b2 toolset=msvc-14.1 link=static runtime-link=static,shared --build-dir=build/x64 address-model=64 -j12 install --includedir=C:\boost_1_72_0\include --libdir=C:\boost_1_72_0\stage\lib\x64  

此处的 j12 表示使用 12 线程