今天在安装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,发现还是报错了:


2260

被折叠的 条评论
为什么被折叠?



