Boost库编译详解

这篇博客详细介绍了如何编译Boost库,特别是针对thread组件。首先通过CMD使用cvs命令获取Boost源代码,接着在VS命令提示符中进入boost/tools/jam/src并执行build.bat来编译jam工具。成功后,返回Boost根目录,运行bjam.exe --with-thread stage,最终在boost/stage/lib找到编译完成的thread库。
摘要由CSDN通过智能技术生成
0.Boost库编译基本理解
VS命令提示符窗口中先编译bjam编译工具,然后对需要的boost库进行编译。


对需要的boost库进行编译:
编译调试版本加 debug
编译发布版本加  release

编译静态链接库:link=static runtime-link=static
编译动态库:link=shared runtime-link=shared
静态库只是需要的文件编译到exe/so中,而且shared的是否用户也要存在dll,所以static是更安全的方式;当然组件式开发和升级的软件用shared方式更加合适(他们都是隐式调用的,dll的显示调用太麻烦了)。


示例:
--toolset=msvc-9.0 architecture=x86 link=static runtime-link=static threading=multi debug release --with-property_tree --with-program_options
bjam --toolset=msvc-9.0 --stagedir=D:\ThirdParty\boost_1_44_0\boost-1_44\stage --with-regex link=shared  threading=multi variant=release runtime-link=shared stage
linux下面:
./bjam --build-type=minimal --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread variant=release link=static threading=multi stage  
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值