root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation$ ls
boost_1_69_0.tar.gz
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation$ tar -zxvf boost_1_69_0.tar.gz
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation$ ls
boost_1_69_0 boost_1_69_0.tar.gz
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation cd boost_1_69_0/
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation/boost_1_69_0$ ls
boost boostcpp.jam boost.png bootstrap.sh index.htm INSTALL libs more status
boost-build.jam boost.css bootstrap.bat doc index.html Jamroot LICENSE_1_0.txt rst.css tools
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation/boost_1_69_0$ ./bootstrap.sh
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2
Unicode/ICU support for Boost.Regex?... not found.
Generating Boost.Build configuration in project-config.jam...
Bootstrapping is done. To build, run:
./b2
To adjust configuration, edit 'project-config.jam'.
Further information:
- Command line help:
./b2 --help
- Getting started guide:
http://www.boost.org/more/getting_started/unix-variants.html
- Boost.Build documentation:
http://www.boost.org/build/doc/html/index.html
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation/boost_1_69_0$ ls
b2 boost-build.jam boost.png bootstrap.sh index.html libs project-config.jam tools
bjam boostcpp.jam bootstrap.bat doc INSTALL LICENSE_1_0.txt rst.css
boost boost.css bootstrap.log index.htm Jamroot more status
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation/boost_1_69_0$ ./b2
編譯完成后,會有如下打印:
成都創(chuàng)新互聯(lián)主營靖安網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,成都APP應(yīng)用開發(fā),靖安h5小程序定制開發(fā)搭建,靖安網(wǎng)站營銷推廣歡迎靖安等地區(qū)企業(yè)咨詢The Boost C++ Libraries were successfully built!
The following directory should be added to compiler include paths:
/home/tony/package/boost_1_69_0
The following directory should be added to linker library paths:
/home/tony/package/boost_1_69_0/stage/lib
root@iZ2ze4aqfcvyxgcvpjrj6iZ:~/software_installation# ./b2 install
安裝完成后,最后會有如下信息打印出來:
ln-UNIX /usr/local/lib/libboost_wave.so
common.copy /usr/local/lib/libboost_exception.a
common.copy /usr/local/lib/libboost_system.a
common.copy /usr/local/lib/libboost_chrono.a
common.copy /usr/local/lib/libboost_timer.a
common.copy /usr/local/lib/libboost_test_exec_monitor.a
...updated 14831 targets...
test.cpp
#include#include#includeusing namespace std;
class Hello
{public:
void say(string name)
{cout<< name<< " say: hello world!"<< endl; }
};
int main()
{Hello h;
auto func = boost::bind(&Hello::say, &h, "小呆鳥");
func();
return 0;
}
執(zhí)行命令
g++ -o test test.cpp -std=c++11
./test
'結(jié)果顯示'
小呆鳥 say: hello world!
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機房具備T級流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級服務(wù)器適合批量采購,新人活動首月15元起,快前往官網(wǎng)查看詳情吧
當(dāng)前題目:【C++網(wǎng)絡(luò)編程—linux下boost庫源碼編譯安裝】-創(chuàng)新互聯(lián)
瀏覽路徑:http://aaarwkj.com/article34/hoope.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、域名注冊、網(wǎng)站導(dǎo)航、靜態(tài)網(wǎng)站、網(wǎng)站設(shè)計公司、網(wǎng)站內(nèi)鏈
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容