1. 使用svn,checkout最新版本
svn co http://svn.boost.org/svn/boost/trunk boost-trunk
或者下载打包文件
Download boost_1_49_0.tar.bz2.
2. 编译boost
默认是编译boost所有的库,如果想针对的编译,请查阅文档
$ cd path/to/boost_1_49_0 $ ./bootstrap.sh
3. 安装boost
$ ./b2 install
4. 设置环境变量
或者编辑~/.bashrc,$ VARIABLE_NAME=path/to/lib/directory:${VARIABLE_NAME} $ export VARIABLE_NAME
添加环境变量定义
VARIABLE_NAME=path/to/lib/directory:${VARIABLE_NAME} ## 注意变量名后不能有空格 export VARIABLE_NAME
执行以下命令,使其生效
source ~/.bashrc