protobuf 编译安装

今天在安装protobuf时,发现网上的protobuf编译安装教程已经落后了,所以记录下来,有需要的朋友可参考。

我是在Ubuntu虚拟机上安装的。

首先在githup上下载源码:

wget -v -O protobuf.zip https://codeload.github.com/protocolbuffers/protobuf/zip/master

然后解压

unzip protobuf.zip

网上的文章是进入该目录后执行:

./configure --prefix=/usr/local/protobuf

但此时,你会发现目录下缺少configure文件,不过有个autogen.sh的脚本,里面有几行注释:

# Run this script to generate the configure script and other files that will
# be included in the distribution.  These files are not checked in because they
# are automatically generated.

即运行这个脚本以生成configure脚本及其他文件。所以我就运行这个脚本,但却报错了:

+ mkdir -p third_party/googletest/m4
+ autoreconf -f -i -Wall,no-obsolete
./autogen.sh: 37: ./autogen.sh: autoreconf: not found

此时需要安装其他辅助工具:

sudo apt-get install automake autoconf

到这里以为ok了,继续运行脚本autogen.sh,发现还是报错了:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值