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
小果子 閱讀(2974)
評論(1) 編輯 收藏 引用 所屬分類:
C++