- 到http://www.boost.org/上下载最新的boost库;下面以boost_1_48_0为例
- 下载完成后,解压到默认文件夹boost_1_48_0;
- 从vs2010的命令行入口到...\boost_1_48_0\tools\build\v2\engine下,执行build.bat,完成后会在boost_1_48_0\tools\build\v2\engine\bin.ntx86下面生成bjam.exe;
- 将bjam.exe拷贝到boost_1_48_0下,然后命令行退回到boost_1_48_0目录下,准备编译;
- 编译前将vs2010添加到boost编译支持中,在boost_1_48_0\tools\build\v2中找到user-config.jam,打开后将
using msvc : 10.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ;
添加到# using msvc ; 下面 - 在命令行中调用bjam编译boost库,如 bjam --without-python --build-type=complete,参数可以自己配置,然后根据不同机器进入慢慢的编译,安心等待吧……
-
- bjam参数:
- 参数
- 意义
- --build-dir=<builddir>
- 编译的临时文件会放在builddir里
- --stagedir=<stagedir>
- 存放编译后库文件的路径,默认是stage
- --build-type=complete
- 编译所有版本
- variant=debug|release
- 编译什么版本(Debug or Release)
- link=static|shared
- 使用静态库还是动态库
- threading=single|multi
- 使用单线程还是多线程库
- runtime-link=static|shared
- 静态还是动态链接C/C++标准库
- --with-<library>
- 只编译指定的库
- --show-libraries
- 显示需要编译的库名称
- bjam参数: