首先准备编译需要的工具:autoconf,automake,libtool,make,g++,unzip。
ubuntu或者debian:
sudo apt-get install autoconf automake libtool curl make g++ unzip
centos:
sudo yum install autoconf automake libtool curl make gcc-c++ unzip
然后下载protobuf源码包:
wget https://github.com/protocolbuffers/protobuf/archive/v3.8.0.tar.gz
解压:
tar -xvf protobuf-3.8.0.tar.gz
编译:
./configure
make
make install