操作系统:kylinV10
protobuf版本:3.11.4
当编译protobuf时,执行以下命令:
./configure --prefix=$LEAN/protobuf3.11.4
出现以下错误:
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /data3/deepblue/projects/build/protobuf-3.11.4/missing aclocal-1.15 -I m4
/data3/deepblue/projects/build/protobuf-3.11.4/missing: line 81: aclocal-1.15: command not found
WARNING: 'aclocal-1.15' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [Makefile:1683: aclocal.m4] Error 127
貌似是缺少了aclocal-1.15这个程序,然后我就开始查询系统中是否安装了aclocal。命令行输入以下执行:
aclocal --version
输出以下内容:
aclocal (GNU automake) 1.16.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl-2.0.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Tom Tromey <tromey@redhat.com>
and Alexandre Duret-Lutz <adl@gnu.org>.
可以看到,本机器上的aclocal版本过高(1.16>1.15),于是想到有两个解决办法:
1.修改configure文件里对aclocal版本的版本号。
2.在本机安装aclocal-1.15
因为考虑到安装aclocal-1.15是把版本降低了,我决定选择1,去改configure文件
打开configure文件,查找aclocal关键字,发现相关内容:
ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
于是再查找am__api_version,发现版本号的具体内容:
am__api_version='1.15'
于是尝试着把1.15修改成1.16,如下所示:
am__api_version='1.16'
修改后,保存文件,继续执行以下命令:
./configure --prefix=$LEAN/protobuf3.11.4
编译成功,鼓掌。