首先下载boost。
下载地址: http://sourceforge.net/projects/boost/files/boost/1.56.0/
编译boost。
可以使用cygwin、MinGW或者vs。由于我安装了vs2012,就使用vs2012编译了。
步骤
1.打开vs2012的command prompt工具。
2.cd到boost的解压目录,执行boost解压包根目录的bootstrap.bat,会生成 b2.exe 、bjam.exe 、project-config.jam 、bootstrap.log四个文件
3.使用bjam.exe来编译boost。
参数为 bjam stage --toolset=msvc-11.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave -- stagedir="c:\boost\boost_1_56_0\bin\vc11" link=static runtime-link=shared runtime-link=static threading=multi debug release
两个重要参数:toolset代表用的编译器的版本,vs2012对应msvc-11.0 stagedir指要编译到那个目录
你也可以把编译参数配置到project-config.jam文件中也是可以的
4.修改VS2012的参数 在项目的组合显示那找到属性页,打开属性页,选择配置属性,选择VC++目录,设置编译好的includepath和libpath。
5.就可以在项目中引入boost了。