1.首先在http://sourceforge.net/projects/boost/files/boost/1.45.0/ 获取源码包。
2.然后任意解压到某个目录下,例如:解压缩到d:/boost目录下。
3.在vs2005中选择如下:
4.打开命令提示窗口后 ,进行如下操作:
1) d: (先切换到d盘)
2)cd d:/boost/boost_1_45_0
3) 运行bootstrap.bat (会在d:/boost/boost_1_45_0/下生成bjam.exe)
5.
设定编译环境(加入红色字体)
修改user-config.jam(d:/boost/boost_1_45_0/tools/build/v2/user-config.jam) 的MSVCconfiguration
# MSVCconfiguration
#Configure msvc (default version, searched in standard location
# andPATH).
# usingmsvc ;
using msvc : 8.0 : : <compileflags>/wd4819<compileflags>/D_CRT_SECURE_NO_DEPRECATE<compileflags>/D_SCL_SECURE_NO_DEPRECATE<compileflags>/D_SECURE_SCL=0 ;
6. 在d:/boost/boost_1_45_0/下执行
bjam--without-python --toolset=msvc-8.0 --build-type=complete--prefix="d:/boost/boost_1_45_0" stage (运行一个小时左右)
7. 完成第6步后执行:
bjam--with-python --toolset=msvc-8.0 --build-type=complete--prefix="d:/boost/boost_1_45_0" install
8.安装完成后,还需要设置vs2005的环境,选择工具-》选项-》项目和解决方案-》c++目录:
在 “库文件” 加上d:\boost\boost_1_45_0\stage\lib
在“包含文件”加上d:\boost\boost_1_45_0\include\boost-1_45
如图: