直接執行命令:html
sudo apt-get install libboost-devios
測試:測試
建立一個 boost_test.cpp 文件,寫入ui
#include<iostream> #include<boost/lexical_cast.hpp> int main() { int a = boost::lexical_cast<int>("36"); std::cout << a <<std::endl; return 0; }
執行命令:spa
g++ boost_test.cpp -o boost_test.net
./boost_testunix
最終結果爲:code
參考教程:htm
http://blog.chinaunix.net/uid-12226757-id-3427282.htmlblog
------------------------------------------------------------------------------------------------------------