protobuf 編譯安裝

2022-08-22 01:42:16 字數 594 閱讀 6788

1、protobuf是google公司提出的資料儲存格式,詳細介紹可以參考:

tar -zxf protobuf-2.5.0.tar.gz
#mkdir /usr/local/protobuf-2.5.0

#cd /usr/local/protobuf-2.5.0

#/opt/protobuf-2.5.0/configure -prefix=/usr/local/protobuf-2.5.0
# make -j8   編譯

# make && install

注意:安裝成功後,將它的bin和lib目錄分別加入到path和ld_library_path環境變數,以方便直接呼叫。

通常建議安裝到/usr/local目錄下,執行configure時,指定--prefix=/usr/local/protobuf即可

export path=$path:/usr/local/protobuf/bin

export ld_library_path=$ld_library_path:/usr/local/protobuf/lib

protobuf編譯安裝

github上有詳細的安裝說明 1 確定centos7上已經安裝了下面的軟體,或者直接用yum進行更新 autoconf automake libtool curl used to download gmock make g unzip tar zxvf protobuf 3.1.0.tar.gz ...

protobuf編譯安裝

安裝新增環境變數 解除安裝依次輸入 configure make j8 make check sudo make install其中,configure可以通過引數來制定安裝位置,如 configure prefix path path 換成指定的位置 推薦安裝到 usr下,這樣會和apt get ...

mac編譯安裝protobuf

1 在安裝protobuf之前需要先安裝git make automake等工具,安裝方法請參考 2 在安裝好protobuf後需要安裝protobuf,依賴庫,首先使用 git clone 轉殖,如下圖所示 3 然後進入到protobuf目錄執行.autogen.sh,此時會出現 configur...