protocolbuffer
簡介:protocolbuffer(如下簡稱PB)是google 的一種數據交換的格式,它獨立於語言,獨立於平臺linux
一 , 編譯安裝c++
下載:[下載地址](https://developers.google.com/protocol-buffers/docs/downloads)
解壓後進入文件安裝:
```bash
./autogen.sh
./configure
make
make check
sudo make install
```
校驗:
```bash
protoc --version
```git
若是make報錯,以下 #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.github
能夠安裝二進制版本 bash
這裏下載 對應版本的 ,https://github.com/google/protobuf/releases ui
是linux機器64位的,下載protoc-3.6.0-linux-x86_64.zipgoogle
下載完成後,解壓,我下載解壓到/usr/local/protoc中spa
獲得bin和include目錄 ,設置環境變量ip
vi /etc/profile get
export PATH=$PATH:/usr/local/go/bin:/usr/local/protoc/bin
保存,從新載入配置
source /etc/profile
#protoc --version
libprotoc 3.4.0
安裝成功