Windows下用VS2022编译安装Boost库

Windows下用VS2022编译安装Boost库

下载地址:

https://www.boost.org/users/download/

解压得到如下文件:

 

 

编译安装:

打开vs2022命令行工具

 

 

切换到boost的目录, 运行boostrap.bat. 即可生成b2.exe等文件.

运行 b2 address-model=64 即可进行编译.

 

如果是64位编译器, 需要加上address-model=64, 否则易报如下错误:

error: Recursion in main target references
error: the following target are being built currently:
error: ./forward -> ./stage -> ./stage-proper -> ***libs/filesystem/build/stage*** -> libs/filesystem/build/stage-dependencies -> libs/log/build/stage -> libs/log/build/stage-dependencies -> ***libs/filesystem/build/stage***

 

使用:

头文件目录:

F:\WorkSpace\CPPLIB\boost_1_79_0

库文件目录:

F:\WorkSpace\CPPLIB\boost_1_79_0\stage\lib

 

posted @ 2023-01-03 23:39  酱_油  阅读(3084)  评论(0编辑  收藏  举报