Protobuf源码编译安装

Protobuf源码编译安装

安装依赖

sudo apt-get install autoconf automake libtool curl make g++ unzip

下载源码

git clone --branch v3.17.3 --recursive https://github.com/google/protobuf.git

编译

./autogen.sh

./configure --prefix=[you wanna install]

make
sudo make install
sudo ldconfig # refresh shared library cache.

note:可能会出此错误

./autogen.sh: 4: ./autogen.sh: autoreconf: not found

解决方案

sudo apt-get install autoconf
sudo apt-get install automake
sudo apt-get install libtool

check version

protoc --version
posted @ 2022-03-22 15:55  nanmi  阅读(392)  评论(0编辑  收藏  举报