ubuntu下编译安装boost1.44.0

1. 解压代码到/boost/boost_1_44_0
2. 生成bjam
   cd boost_1_44_0/tools/jam/src
   ./build.sh (如果没有执行权限,需要chmod一下)
   cd bin.linux* 查看一下bjam已经生成
   export PATH=$PATH:/boost/boost_1_44_0/tools/jam/src/bin.linux* //把bjam程序所在目录设为搜索目录
3. 编译安装boost
   cd /boost/boost_1_44_0
   bjam install
4. 测试test.cpp
#include <iostream>
#include <boost/scoped_ptr.hpp>

int main(int argc,char **argv)
{
   int pcr = 100;
   boost::scoped_ptr <int> m_lastPCR;
   m_lastPCR.reset(new int(pcr));
   std::cout<<"boost: "<<*m_lastPCR<<std::endl;
   return 0;
}
   g++ test.cpp -o test
   ./test
输出打印:
 boost: 100

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值