大约要个十几分钟 编译完成后: The Boost C++ Libraries were successfully built! The following directory should be added to compiler include paths: /home/terry/Local/boost_1_47_0 The following directory should be added to linker library paths: /home/terry/Local/boost_1_47_0/stage/lib 因为我是解压到/home/terry/Local/boost_1_46_1下了 所以编译完了是这样的
5.update动态链接库:
sudo ldconfig
安装完毕
三,测试使用:
1.测试代码 #cat test.cpp #include #include
int main() { using boost::lexical_cast; int a= lexical_cast("123456"); double b = lexical_cast("123.456"); std::cout << a << std::endl; std::cout << b << std::endl; return 0; }
2.编译,运行
--g++ -o test test.cpp #ls test test.cpp # ./test 123456 123.456