1. 安装boost库
sudo apt-get install libboost-all-dev
2测试
test.cpp
#include <boost/lexical_cast.hpp>
#include <iostream>
int main()
{
}
编译:
g++ test.cpp -I$BOOST_INCLUDE -L$BOOST_LIB -o test
./test
输出:
123
123.12