boost庫在ubuntu下的安裝

2021-08-03 08:28:30 字數 1003 閱讀 1230

系統是ubuntu虛擬機器,安裝的是boost_1_60_0。

。(2)進入到自己的目錄,解壓:

bzip2 -d boost_1_60_0.tar.bz2

tar xvf boost_1_60_0.tar

(3)之後進入boost目錄

cd boost_1_60_0/

./bootstrap.sh之後會產生bjam和b2兩個工具

sudo ./b2 install(確定已經安裝了g++與gcc,此過程會花費一些時間)

這個時候你的/usr/local/include下會產生boost的標頭檔案,

/usr/local/lib下面會產生boost庫

(4)切換到cd /etc/profile.d目錄下,使用超級使用者建立檔案boost.sh

裡面新增如下內容

#!/bin/sh

boost_root=/home/lyndon/boost_1_60_0(boost的解壓路徑)

boost_include=/usr/local/include/boost

boost_lib==/usr/local/lib

export boost_include boost_lib boost_root

修改boost.sh的許可權 sudo chmod +x boost.sh,執行./boost.sh

(5)至此,安裝完畢,測試**

在你工作目錄下隨便乙個地方寫乙個測試檔案

我的**如下,只是測試了簡單的noncopyable使用:

//

boost庫中noncopyable使用

#include #include using

namespace std;

class myclass : public boost::noncopyable

myclass(int i) {}

};int main()

(6)編譯執行,ok。

接下來就可以深入學習boost庫了。

在Ubuntu下配置boost庫

1 進入到自己的目錄,解壓 bzip2 d boost 1 66 0.tar.bz2 tar xvf boost 1 66 0.tar 2 之後進入boost目錄 cd boost 1 66 0 bootstrap.sh之後會產生bjam和b2兩個工具 sudo b2 install 前提需要安裝g...

Ubuntu下安裝boost庫

安裝環境 ubuntu 14.04 步驟 直接使用 apt get進行安裝 sudo apt get install libboost dev測試 include include boost lexical cast.hpp int main 這裡boost環境已經搭建好。另外,由於我直接使用apt...

ubuntu下boost庫的安裝

boost 準標準庫 安裝過程。系統是ubuntu虛擬機器,安裝的是boost 1 60 0。2 進入到自己的目錄,解壓 bzip2 d boost 1 60 0.tar.bz2 tar xvf boost 1 60 0.tar 3 之後進入boost目錄 cd boost 1 60 0 boots...