【 安装3.6.1 (实际应用版本protobuf-3.21.12)】
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.11.2/protobuf-all-3.11.2.tar.gz tar zxf protobuf-all-3.11.2.tar.gz cd protobuf-3.11.2 # 或者 安装3.6.1 wget https://github.com/protocolbuffers/protobuf/releases/download/v3.6.1/protobuf-all-3.6.1.tar.gz tar zxf protobuf-all-3.6.1.tar.gz cd protobuf-3.6.1 ./configure -prefix=/usr/local/ sudo make # 要编译很久 sudo make check sudo make install protoc --version
【编译 proto】
cd protobuf-3.11.2 cd examples mkdir tutorial protoc --go_out=tutorial addressbook.proto ll tutorial # 显示结果 # total 12K # -rw-r--r--. 1 root root 8.7K Jan 2 12:55 addressbook.pb.go
【实际安装v3.21.12版本过程与问题】
wget https://github.com/protocolbuffers/protobuf/releases/download/v3.21.12/protobuf-3.21.12.tar.gz
tar zxf protobuf-3.21.12.tar.gz
cd protobuf-3.21.12
./autogen.sh
./configure -prefix=/usr/local/protobuf
configure.ac:109: error: possibly undefined macro: AC_PROG_LIBTOOL
https://blog.csdn.net/turbock/article/details/107718734
https://blog.csdn.net/Fyear100/article/details/93503723
# centos7
yum -y install libtool libsysfs
#ubuntu 22.04
sudo apt-get install libtool
./configure -prefix=/usr/local/protobuf
sudo make # 要编译很久
sudo make check
sudo make install
protoc --version
标签:3.6,12,protobuf,tar,make,sudo,CentOS7,linux From: https://www.cnblogs.com/opensmarty/p/17036386.html