boost 1_45_0 + vs 2005 安装

1.下载安装包boost 1_45_0
   
http://sourceforge.net/projects/boost/files/boost/1.45.0/
   选择下载 windows 或 unix 版本


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


3.编译bjam
 
 (1)从vs2005的工具菜单进入命令提示窗口(单击“开始”按钮,指向“所有程序”,指向“Microsoft Visua l Stuio 2005”,指向"工具",然后单击“Visual Studio 2005 command prompt(命令提示)”
    (2)cd到d:/boost/boost_1_45_0下执行bootstrap.bat,然后,会在d:/boost/boost_1_45_0/下生成bjam.exe,
    (3)將bjam.exe复制到d:/boost/boost_1_45_0/下。

4.设定编译环境(加入红色字体)   
  修改user-config.jam (d:/boost/boost_1_45_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 : 8.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_45_0/下执行 
    (1) 编译boost库 
        bjam --without-python --toolset=msvc-8.0 --build-type=complete --prefix="d:/boost/boost_1_45_0" stage (这一步需要等待很长时间,大概一个小时左右……)

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

(这一步时间也较长)。

6.设定vs2005环境。(注:在2010环境下这步,在项目-->右键属性-->VC++ Directories 中去填写对应路径 ) 
  Tools -> Options -> Projects and Solutions -> VC++ Directories 
  在Library files加上d:/boost/boost_1_45_0/lib 
  在Include files加上d:/boost/include/boost-1_45

7.测试实例:

#include <boost/lambda/lambda.hpp>  
#include <iostream>  
#include <iterator>  
#include <algorithm>  

int main()  
{  
    using namespace boost::lambda;  
    typedef std::istream_iterator<int> in;  
   std::for_each(in(std::cin), in(), std::cout << (_1 * 3) << " " );  
}


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值