Boost库编译使用基本操作命令

来源:互联网 发布:it培训 先入职再交钱 编辑:程序博客网 时间:2024/05/16 11:16
1、用编译器命令窗口进入Boost目录执行下面语句生成了b2.exe、bjam.exe、project-config.jam文件。

booststrap.bat

2、查看需要编译才能使用的库列表 

bjam --show-libraries 

3、执行下面语句进行编译生成库(下面不编译Python库)

动态库
bjam stage --toolset=msvc-11.0 --without-python --build-type=complete --stagedir="E:\QGMPlug
\boost_1_60_0\bin\vc11" link=shared runtime-link=shared threading=multi debug release


静态库
bjam stage --toolset=msvc-11.0 --without-python --build-type=complete --stagedir="E:\QGMPlug
\boost_1_60_0\bin\vc11" link=static runtime-link=static threading=multi debug release


4、boost默认是以静态方式链接的,如果想使用dll动态方式链接,需要预先定义宏:

#define BOOST_ALL_DYN_LINK


5、另外还有一个比较有用的宏,它可以让VC在编译时的output窗口中输出程序具体链接了哪些boost库以及链接顺序。

#define BOOST_LIB_DIAGNOSTIC
0 0
原创粉丝点击