Boost常用的编译选项

Linux下:  C++代码 2

 ./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 

   

  ./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   :


 许多新人对于编译BOOST感到无从下手,甚至因此而放弃使用BOOST,那真的太可惜了,下面我把一些常用的BOOST编译方法贴于此,同时也作为自己的笔记。 

首 先下载bjam.exe,复制到 $BOOST$ 目录下。或者自己生成bjam,打开Visual Studio 2008 命令提示窗口$BOOST$\tools\jam\src,执行 build.bat 会在$BOOST$\tools\jam\src\bin.ntx86 生成 bjam.exe 文件。复制文件 bjam.exe  文件到 $BOOST$\下

。 1.完全编译安装: bjam --toolset=msvc install 完成后会生成一个bin.v2编译时的临时目录,手动删除。生成另一个目录C:\boost,里面为所有的头文件和库文件。头文件目录为boost_1_34_1\boost目录复制过去的。

 2.只编译相应的库文件 bjam --toolset=msvc stage 完成后同样会生成bin.v2临时目录。另一个目录为stage文件,里面有对应的库文件。

 3.查看需要编译才能使用的库列表 bjam --show-libraries

 4.编译特定的库,如只编译regex bjam --toolset=msvc --with-regex stage 生成的库文件在stage目录中。

 5.不编译某个库,如不编译regex bjam --toolset=msvc --without-regex stage 生成的库文件在stage目录中。

 6.编译特定的库,如只编译regex,生成debug,多线程,共享连接版本,并保存在stage。 bjam --toolset=msvc --with-regex stage debug threading=multi link=shared 

7.生成 mt-sgd 的静态库(runtime-link-static) bjam "-sTOOLS=vc-8_0" --with-thread install debug release runtime-link=static 


8.编译regex库。 bjam --toolset=msvc --with-regex stage debug release threading=multi threading=single link=shared link=static runtime-link=shared runtime-link=static boost的安装方法: 对于DLL版本 bjam --toolset=msvc link=shared runtime-link=shared


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值