xiaoguozi's Blog
Pay it forword - 我并不觉的自豪,我所尝试的事情都失败了······习惯原本生活的人不容易改变,就算现状很糟,他们也很难改变,在过程中,他们还是放弃了······他们一放弃,大家就都是输家······让爱传出去,很困难,也无法预料,人们需要更细心的观察别人,要随时注意才能保护别人,因为他们未必知道自己要什么·····
http://blog.sina.com.cn/s/blog_6f2caee40100uhj6.html
1.下载最新的boost
http://www.boost.org/
2.解压文件
tar -xzvf boost_1_45_0.tar.gz 
3.编译bjam
进入boost_1_45_0目录中,运行./bootstrap.sh,完成后会得到一个bjam
4.编译boost 
./bjam --with-date_time --with-system --with-regex --with-thread --with-filesystem --with-serialization --with-iostreams --with-math --with-mpi --with-program_options --with-python --with-math --with-signals --layout=tagged install variant=debug,release link=static --runtime-link=static threading=multi stage
5.查看boost
编译完成后,在/usr/local/include/boost就有最新的boost头文件了,在/usr/local/lib就有编译好的.a库文件了。
虽然usr/local/include和/usr/include都有目录,但GCC是先访问/usr/local/include,所以编译完成后,就可以默认使用boost了。
6.测试boost
vi testboost.cpp
#include <iostream>
#include <boost/version.hpp>
int main()
{
    std::cout<<BOOST_VERSION<<std::endl;
    return 0;
}
编译:g++ -o testboost testboost.cpp
posted on 2013-01-07 16:38 小果子 阅读(2931) 评论(1)  编辑 收藏 引用 所属分类: C++

FeedBack:
# re: Centos编译boost
2013-12-30 15:34 | Penn
谢谢分享!@  回复  更多评论
  

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理