1. 下载

官网:http://www.boost.org/

主页:https://sourceforge.net/projects/boost/

当前最新版:V1.61.0

2. 编译

首先,生成bjam和b2工具。

安装boost库(Windows)-LMLPHP

然后,对不同版本的MSVC生成库文件。

名称VS版本
msvc-6.0VS6.0
msvc-7.1VS2003
msvc-8.0VS2005
msvc-9.0VS2008
msvc-10.0VS2010

vs2005:

bjam stage --toolset=msvc-8.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="C:\boost\bin\vc8" link=static runtime-link=shared runtime-link=static threading=multi debug release

vs2010:

bjam stage --toolset=msvc-10.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="C:\boost\bin\vc10" link=static runtime-link=shared runtime-link=static threading=multi debug release

3. 使用

(1) 头文件

拷贝C:\boost_1_61_0\boost文件夹到C:\boost

(2) IDE设置

a. 头文件引用

Project->Properties->Configuration Properties->C/C++->General

Additional Include Directories: 增加(1)中根目录。

安装boost库(Windows)-LMLPHP

b. 库链接

Project->Properties->Configuration Properties->Linker->General

Additional Library Directories: 增加生成库目录

安装boost库(Windows)-LMLPHP

参考文档:

1. Builtin tools

http://www.boost.org/build/doc/html/bbv2/reference/tools.html#bbv2.reference.tools.compiler.msvc

2. Boost下载安装编译配置使用指南(含Windows、Linux以及ARM Linux)

http://www.cnblogs.com/wondering/archive/2009/05/21/boost_setup.html

04-21 00:25
查看更多