下载,解压,按照如下步骤:
#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
DetectingPython version...2.6
DetectingPython root.../usr
Unicode/ICU support forBoost.Regex?...not found.
GeneratingBoost.Build configuration in project-config.jam...
Bootstrappingisdone.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
然后就是漫长的等待,如果最后出现:TheBoost 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
最后就是安装:
#./b2 install --prefix=/usr/local
安装后的头文件在/usr/local/include/boost里面,而相应的库在/usr/local/lib/libboost_*