vc 2017单独编boost python命令行如下 ,在“适用于 VS 2017 的 x64 本机工具命令提示”命令行窗口下编译。
编译出boost python静态库:
b2 toolset=msvc-14.1 --build-type=complete --with-python link=static address-model=64
在boost_1_77_0\stage\lib 目录下编译出:
libboost_python39-vc141-mt-gd-x64-1_77.lib
libboost_python39-vc141-mt-s-x64-1_77.lib
libboost_python39-vc141-mt-sgd-x64-1_77.lib
libboost_python39-vc141-mt-x64-1_77.lib
libboost_python39-vc142-mt-gd-x64-1_77.lib
libboost_python39-vc142-mt-x64-1_77.lib
编译出boost python动态库:
b2 toolset=msvc-14.1 --build-type=complete --with-python link=shared address-model=64 --user-config="D:\Libs\boost_1_77_0\user-config.jam"
编译boost python 动态库 ,需要通过用户配置文件user-config.jam指定本机安装的python的头文件目录 ,库目录 。
user-config.jam的全部内容如下:
using python : 3.9 : "C:\Tools\Python39\" : "C:\Tools\Python39\include\" : "C:\Tools\Python39\libs\" ;
这里 D:\Libs\boost_1_77_0\ 为本机boost 1.77 目录 ,C:\Tools\Python39\ 为本机python 3.97 目录 。
在boost_1_77_0\stage\lib 目录下编译出:
boost_python39-vc141-mt-gd-x64-1_77.dll
boost_python39-vc141-mt-gd-x64-1_77.lib
boost_python39-vc141-mt-gd-x64-1_77.pdb
boost_python39-vc141-mt-x64-1_77.dll
boost_python39-vc141-mt-x64-1_77.lib
附:
b2\bjam 的User Manual参考文档在此:
https://www.bfgroup.xyz/b2/
https://www.bfgroup.xyz/b2/manual/release/index.html