Ubuntu安装Protobuf,指定版本

参考:https://github.com/protocolbuffers/protobuf#readme

https://github.com/protocolbuffers/protobuf/blob/v3.20.3/src/README.md

其实官网的readme给的步骤很详细。

1.安装相关依赖

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

1.克隆仓库

git clone https://github.com/protocolbuffers/protobuf.git

# 可以使用https://ghproxy.com/作为代理,会快很多,如下:

git clone https://ghproxy.com/https://github.com/protocolbuffers/protobuf.git

2.切换分支

# 切换分支,这是我的需求,根据你自己的需求进行更改
git checkout v3.20.3


# 检查分支状态

git status

3.拉取子模块

cd protobuf

git submodule update --init --recursive

./autogen.sh

4.开编

 ./configure

# 可以安装到指定文件夹
./configure --prefix=/usr

 make -j$(nproc)

 make check

 sudo make install

 sudo ldconfig 

  其实就是官方文档的readme,多看看,英文看习惯了就好了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值