protocolbuffer
简介:protocolbuffer(以下简称PB)是google 的一种数据交换的格式,它独立于语言,独立于平台
一 , 编译安装
下载:[下载地址](https://developers.google.com/protocol-buffers/docs/downloads)
解压后进入文件安装:
```bash
./autogen.sh
./configure
make
make check
sudo make install
```
校验:
```bash
protoc --version
```
如果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.
可以安装二进制版本
这里下载 对应版本的 ,https://github.com/google/protobuf/releases
下载完成后,解压,我下载解压到/usr/local/protoc中
得到bin和include目录 ,设置环境变量
vi /etc/profile
export PATH=$PATH:/usr/local/go/bin:/usr/local/protoc/bin
保存,重新载入配置
source /etc/profile
#protoc --version
libprotoc 3.4.0
安装成功