1、从github下载protobuff源码。
https://github.com/google/protobuf
2、安装依赖项:
* autoconf
* automake
* libtool
* curl (used to download gmock)
执行下面即可:
$ sudo apt-get install autoconf automake libtool curl
3、产生安装脚本:
$ ./autogen.sh ##注意:此处需要翻墙才能成功
4、安装:
$ cd protobuf-master
$ ./configure --prefix=/usr/local/protobuf ##这里是定义安装的位置