1.获取protobuf。
git clone https://github.com/protocolbuffers/protobuf.git
2.unzip安装
apt-get install autoconf automake libtool curl make g++ unzip
3.生成configure文件
./autogen.sh
4.生成makefile
./configure --prefix=/usr/local/protobuf
5.编译安装
make
make check
make install
6.加载config
ldconfig # refresh shared library cache.
7.编译协议代码
protoc ./test.proto --cpp_out=./