先放需要用到的git库:
核心Protobuf库:
码云极速下载/google-protobufsourcegitee.com
第三方库:
码云极速下载/google-benchmarkgitee.com

先是下载对应的库
sudo su
cd /usr/local/src
git clone https://gitee.com/mirrors/protobufsource.git protobuf
git clone https://gitee.com/mirrors/googletest.git protobuf/third_party/googletest
git clone https://gitee.com/mirrors/google-benchmark.git protobuf/third_party/benchmark
然后更新
cd protobuf
git submodule update --init --recursive
./autogen.sh
接下来是安装
./configure
make -j32
make check -j32
make install
ldconfig
根据自己CPU的线程数调整-j后面的数
安装完成。
protoc --version
查看protoc版本。
至于为什么要通过gitee,不觉得github直接下载超级慢么!