1 官方文档
www.boost.org2 安装2.1 ubuntu sudo apt-get install libboost-all-dev2.2 centoswget http://sourceforge.net/projects/boost/files/boost/1.57.0/boost_1_57_0.tar.gz/downloadtar -zxvf boost_1_57_0.tar.gz cd boost_1_57_0编译(参考 http://blog.csdn.net/hzdiy/article/details/18888477)./bootstrap.sh --with-libraries=system,filesystem,log,thread --with-toolset=gcc ./b2 toolset=gcc cxxflags="-std=c++11" ./b2 install --prefix=/usr 3 测试使用vim test.cpp#include <boost/lexical_cast.hpp>#include <iostream>int main(){ using boost::lexical_cast; int a= lexical_cast<int>("123456"); double b = lexical_cast<double>("123.456"); std::cout << a << std::endl; std::cout << b << std::endl; return 0;}编译运行g++ -o test test.cpptest test.cpp./test123456123.456