注意,内容参考Ididcan的CSDN Blog,修改为最新的Boost1.46.1
-------------------
下载安装包boost 1_46_1
http://sourceforge.net/projects/boost/files/boost/1.46.1/
以下假设解压缩到D:\
1.编译bjam
(1)进入Visual Studio 2010 commandprompt(单击“开始”按钮,指向“所有程序”,指向“Microsoft Visual Studio 2010”,指向“VisualStudio tools(工具)”,然后单击“Visual Studio 2010 commandprompt(命令提示)”
(2)cd 到 D:\boost_1_46_1\tools\build\v2\engine\src 执行build.bat,之后在D:\boost_1_46_1\tools\build\v2\engine\src\bin.ntx86下生成bjam.exe,
(3)将bjam.exe复制到D:\boost\boost_1_46_1\下。
2.编译环境设定
修改user-config.jam(d:\boost\boost_1_43_0\tools\build\v2\user-config.jam)的MSVCconfiguration,加入红色字体
# -------------------
# MSVC configuration.
# -------------------
# Configure msvc (default version, searched for in standardlocations and PATH).
# using msvc ;
# Configure specific msvc version (searched for in standardlocations and PATH).
# using msvc : 8.0 ;
using msvc : 10.0 : :<compileflags>/wd4819<compileflags>/D_CRT_SECURE_NO_DEPRECATE<compileflags>/D_SCL_SECURE_NO_DEPRECATE<compileflags>/D_SECURE_SCL=0;
3.CD D:\boost_1_46_1\ ,进入D:\boost_1_46_1\
编译boost库,输入
bjam --without-python --toolset=msvc-10.0 --build-type=complete--prefix="d:\boost\boost_1_43_0" stage
bjam --without-python --toolset=msvc-10.0 --build-type=complete stage
编译完成后
安装,输入:
bjam --with-python --toolset=msvc-10.0 --build-type=complete--prefix="d:\boost\boost_1_43_0" install
之后在VS2010中配置VC++目录即可