单独编译Boost库

下载最新的boost库,我的版本是boost_1_73_0。

下载好后执行 bootstrap.bat,会生成 b2.exe,之前的版本会同时生成 bjam.exe。

 

创建批处理文件 build_show.bat,编辑内容如下:

b2 --show-libraries
pause

会列出boost所有需要编译的库名称。

 

创建批处理文件 build_time.bat,编辑内容如下:

b2 --with-date_time --toolset=msvc-14.1 variant=debug link=static
pause

--with:为要编译的目标库,如date_time,regex等;

--toolset=:为编译平台,vs2015=14.0 / vs2017=14.1;

variant=:为 debug / release;

link=:为链接方式;

 

如需要编译其他boost库只需替换with后的字段就可以。

posted @ 2020-10-27 17:59  sev  阅读(527)  评论(0编辑  收藏  举报