下载
https://github.com/google/protobuf/releases 找到对应版本下载
编译
cd protobuf
./autogen.sh
./configure
make
安装
make install
查看
protoc --version
Points
./autogen.sh是获取GoogleMock,并生成对应的configure脚本
./configure是进行环境检测,并生成对应的makefile或Makefile --prefix=/usr/local可以指定安装路径
make,按照makefile编译工程
make install,执行makefile里面的install部分,进行安装 --prefix=/usr/local可以指定安装路径