http://www.boost.org/
安裝
文件解壓在/usr/local/目錄下
在/usr/local/boost-*目錄下,執行./bootstrap.sh
在/usr/local/boost-*目錄下,執行sudo ./bjam --layout=versioned --build-type=complete --toolset=gcc install
在/etc/profie中添加:
export BOOST_INCLUDE=/usr/local/include/boost-1_52
export BOOST_LIB=/usr/local/lib
測試
test.cpp
#include <boost/lexical_cast.hpp>
#include <iostream>
int main()
{
using boost::lexical_cast;
int a = lexical_cast<int>("123");
double b = lexical_cast<double>("123.12");
std::cout<<a<<std::endl;
std::cout<<b<<std::endl;
return 0;
}
編譯
g++ test.cpp -I$BOOST_INCLUDE -L$BOOST_LIB -o test
gcc下編譯命令爲gcc test.cpp -I$BOOST_INCLUDE -L$BOOST_LIB -lstdc++ -o test
boost中文手冊
http://stlchina.huhoo.net/twiki/bin/view.pl/Main/BoostIndex
安裝
http://blog.csdn.net/garfier/article/details/7773409
http://www.cnblogs.com/zhangchaoyang/articles/2048952.html
boost c++ library on linux 初體驗
http://blog.csdn.net/garfier/article/details/7773409
vim cpp補齊插件OminCppComplete安裝,boost庫ctags文件生成腳本