您的位置:首页 > 运维架构 > Linux

centos6.5安装boost

2015-10-15 19:24 549 查看
1、解压boost_1_58_0.tar.bz2

tar -vxf boost_1_58_0.tar.bz2

2、编译

cd boost_1_58_0

./bootstrap.sh

这里会生成两个文件bjam和b2,这两个是一样的

3、./b2 install

测试安装是否成功
#include<iostream>
#include<boost/bind.hpp>

using namespace std;
using namespace boost;

int fun(int x,int y)
{
return x + y;
}

int main(){
int m=1;
int n=2;
cout << boost::bind(fun,_1,_2)(m,n) << endl;
return 0;
}编译、链接命令:g++ test.cpp -o test
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  boost 安装 gcc