Vs2008使用boost
1.下载boost:http://www.boost.org/users/download/
2.进入VC命令行(用于设置VC的编译环境):开始->所有程序->Microsoft Visual Studio 2008->Visual Studio Tools/Visual Studio 2008 命令提示,打开VC命令行(或者直接执行VS2008安装目录下的“Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat”);
3.在VC命令行下进入“[BOOST_ROOT]\tools\jam\src”(tools/build/src/engine)目录,执行build.bat;
4.将bjam.exe文件复制到[BOOST_ROOT]目录下;
5.在VC命令提示符下面进入[BOOST_ROOT]目录,执行编译命令
bjam stage --toolset=msvc-9.0 --without-python --stagedir=".\bin\vc9" link=shared link=static runtime-link=shared runtime-link=static threading=multi debug release
6.打开:工具->选项->项目和解决方案->VC++目录。
7.在include目录中加上:[BOOST_ROOT]\boost,这个是压缩包中自带的头文件目录
8.在library目录中加上:[BOOST_ROOT]\bin\vc9\lib,这个是编译时指定生成的目录(上面编译指令中指定的是\bin\vc9);
9.之后就可以在新建的目录下,使用boost的库了
10.实例:#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr CTestPtr;