依次執行下列命令:
sudo
apt-get
install
autoconf automake libtool curl
make
g++ unzip
git clone https:
//github
.com
/google/protobuf
.git
// 指定分支clone
git clone -b 3.9.x https:
//github
.com
/google/protobuf
.git // 3.9.x爲指定分支
cd
protobuf
git submodule update --init --recursive
.
/autogen
.sh
.
/configure
make
make
check
sudo
make
install
sudo
ldconfig
# refresh shared library cache.
可能遇到問題
很有可能,執行過程中會出現以下錯誤提示:
./autogen.sh: 4: ./autogen.sh: autoreconf: not found
解決辦法:執行以下命令即可。
1 2 3 |
|
安裝完成之後
執行以下命令驗證安裝結果,查看版本號。
protoc --version