linux平台下要编译安装除gcc和gcc-c++之外,还需要两个开发库:bzip2-devel 和python-devel,因此在安装前应该先保证这两个库已经安装:

#yum install gcc gcc-c++ bzip2 bzip2-devel bzip2-libs python-devel -y

然后是去官网下载源码包,地址
下载,解压,按照如下步骤:

#tar xvzf boost_1_50_0.tar.gz

进入boost_1_50_0目录:

#cd boost_1_50_0

然后是编译安装,boost源码包中有配置脚本,直接用就可以:

#sh ./bootstrap.sh

Building Boost.Build engine with toolset gcc... tools/build/v2/engine/bin.linuxx86_64/b2
Detecting Python version... 2.6
Detecting Python root... /usr
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...

Bootstrapping is done. To build, run:

./b2
   
To adjust
configuration, edit 'project-config.jam'.
Further information:

- Command line help:
     ./b2 --help
    
   - Getting started guide:
     http://www.boost.org/more/getting_started/unix-variants.html
    
   - Boost.Build documentation:
     http://www.boost.org/boost-build2/doc/html/index.html

接下来就是编译,重点关注是否编译成功:

#./b2

然后就是漫长的等待,如果最后出现:

The Boost C++ Libraries were
successfully built!
         
The following
directory should be added to compiler include paths:
          
    /home/gang/BAK/boost_1_50_0
     
The following
directory should be added to linker library paths:
     
    /home/gang/BAK/boost_1_50_0/stage/lib

表示编译成功,如果没有成功,就需要回查看哪里出现error,再安装相应的库,
最后就是安装:

#./b2 install --prefix=/usr/local

安装后的头文件在/usr/local/include/boost里面,而相应的库在/usr/local/lib/libboost_*

最新文章

  1. Android 手机卫士--阶段小结1
  2. setInterval和setTimeout的区别
  3. 初学structs2,表单验证简单补充
  4. 【转载】Gambit使用教程
  5. JS获取Url参数的通用方法
  6. iOS UILable高度自适应
  7. 【 Failed to create the Java Virtual Machine】的2种解决方式
  8. HDU 1394 Minimum Inversion Number(线段树 或 树状数组)
  9. Swift - 使用相机拍摄照片
  10. MySql数据库SQL语句将编码
  11. linux(fedora) 下dvwa 建筑环境
  12. 设置批量商品优惠、如何修改ZenCart产品显示图片的大小
  13. Ubuntu命令模式基础
  14. SpringBoot整合Jsp和Thymeleaf (附工程)
  15. python第四章:函数--小白博客
  16. Python:matplotlib绘制线条图
  17. python时间模块time
  18. 广商博客冲刺第三天new
  19. nodejs 使用http模块保存源码
  20. win7 wamp 64位 php环境如何开启curl服务?

热门文章

  1. MySQL-07 日志管理
  2. java session cookie的使用
  3. 深入理解typeof操作符
  4. composer 设置代理
  5. Android 图片设置圆角
  6. Web框架下安全漏洞的测试反思
  7. 图的最小生成树——Prim算法
  8. E-R图
  9. php中configure报错问题
  10. [luoguP2513] [HAOI2009]逆序对数列(DP)