下载: boost_1_49_0.tar.bz2
$ sudo tar -jxvf boost_1_49_0.tar.bz2
$ cd boost_1_49_0
$ sudo ./bootstrap.sh
$ sudo ./b2
等着就行了
....
完成了
$ sudo cp -r boost /usr/include/
$sudo cp stage/lib/* /usr/lib
到此你的boost就可以使用了.
如果采用 install 的话
./bjam cxxflags=-fPIC --without-python --without-graph_parallel --without-graph --without-wave install
默认安装在 /usr/local 下
不过我个人更喜欢 /usr 下
./bjam cxxflags=-fPIC --prefix=/usr --without-python --without-graph_parallel --without-graph --without-wave install
谨记这个参数
cxxflags=-fPIC
如果你在Linux x64 下使用boost的静态文件 一定把这个参数加上 否则会出错.
否则会出现这类的错误:
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../
....
can not be used when making a shared object; recompile with -fPIC
如果要配置boost当然也可以配置了
1 修改 project-config.jam
2 在 ./b2 后面加参数
3 在 ./bjam 后面加参数
./b2 和 ./bjam 貌似一样的
bjam --with-thread --toolset=gcc--build-type=complete stage stdlib=stlport
bjam --without-python --toolset=msvc --build-type=complete stage
http://blog.csdn.net/gengshenghong/article/details/7320369