一、Boost库的介绍
二、Boost库的地址
三、Boost库的安装和编译
- BCC5.5/BCB6/BCB2006/CB2009用户输入:build borland。
- VC用户依据其版本输入:build vc7或vc8或vc9。
- Mingw用户输入:build mingw。
bjam --toolset=borland(对应BCB)或msvc(对应VC)或gcc(对应Mingw) stage
- bjam --toolset=msvc-8.0 --build-type=complete --prefix="d:\Program Files\Boost\boost_1_42_0" stage
- bjam
--toolset=msvc-9.0 --build-type=complete --prefix="d:\boost_1_42_0" install
- toolset:所使用compiler,Visual Studio 2005 为 msvc-8.0。
- build-type:编译类型,complete表示生成所有的版本(debug,release等)。
- prefix:指定编译后library的的目录。
BOOST_ROOT=D:\Program Files\Boost\boost_1_42_0
- 在Library files中加入:D:\Program Files\Boost\boost_1_42_0\stage\lib
- 在Include files中加入:D:\Program Files\Boost\boost_1_42_0\boost
--build-dir=<builddir> | 编译的临时文件会放在builddir里(编译完就可以把它删除了) |
--stagedir=<stagedir> | 存放编译后库文件的路径,默认是stage |
--build-type=complete | 编译所有版本,不然只会编译一小部分版本(相当于: variant=release,threading=multi; link=shared|static;runtime-link=shared) |
variant=debug|release | 决定编译什么版本(Debug or Release) |
link=static|shared | 决定使用静态库还是动态库 |
threading=single|multi | 决定使用单线程还是多线程库 |
runtime-link=static|shared | 决定是静态还是动态链接C/C++标准库 |
--with-<library> | 只编译指定的库,如输入--with-regex就只编译regex库了 |
--show-libraries | 显示需要编译的库名称 |
转自龙宇的博客http://blog.sina.com.cn/s/blog_40b056950100ht8p.html