vs2010 boost库安装

来源:互联网 发布:艾默生网络能源怎么样 编辑:程序博客网 时间:2024/05/17 01:11
.下载安装包boost 1_43_0
   http://sourceforge.net/projects/boost/files/boost/1.43.0/
   选择下载 windows 或 unix 版本

2.解压缩到d:\boost目录下

3.编译bjam
 
 (1)从vs2010的工具菜单进入命令提示窗口(单击“开始”按钮,指向“所有程序”,指向“Microsoft Vis l St io 2010”,指向“Vis l St io tools(工具)”,然后单击“Vis l St io 2010 command prompt(命令提示)”
    (2)cd到d:\boost\boost_1_43_0\tools\jam\src下执行build.bat,然后,会在d:\boost\boost_1_43_0\tools\jam\src\bin.ntx86\下生成bjam.exe,
    (3)將bjam.exe复制到d:\boost\boost_1_43_0\下。

4.设定编译环境(加入红色字体)   
  修改user-config.jam (d:\boost\boost_1_43_0\tools\build\v2\user-config.jam) 的MSVC configuration 
  # MSVC configuration 
   
  # Configure msvc (default version, searched in standard location 
  # and PATH). 
  # using msvc ; 
  using msvc : 10.0 : : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL=0 ;

5.將目录cd到d:\boost\boost_1_43_0\下执行 
    (1) 编译boost库 
        bjam --without-python --toolset=msvc-10.0 --build-type=complete --prefix="d:\boost\boost_1_43_0" stage

    运行完后(弹出输入提示符)
    (2) 则安装,输入: 
       bjam --with-python --toolset=msvc-10.0 --build-type=complete --prefix="d:\boost\boost_1_43_0" install

6.设定vs2010环境。(注:在2010环境下这步,在项目-->右键属性-->VC++ Directories 中去填写对应路径 ) 
  Tools -> Options -> Projects and Solutions -> VC++ Directories 
  在Library files加上d:\boost\boost_1_43_0\lib 
  在Incl e files加上d:\boost\boost_1_43_0\incl e

D:\boost_1_43_0>.\bjam install --toolset=msvc-10.0 --without-python --prefix=D:\boost

编译完的lib可能多出lib 我是手工重命名的,去掉lib就行
0 0
原创粉丝点击