libtool:版本不匹配错误:2.4.6(预期)与2.4.6.42-b88ce(实际),aclocal无效

问题描述 投票:0回答:1

make上,我收到此错误:

libtool: Version mismatch error.  This is libtool 2.4.6.42-b88ce, but the
libtool: definition of this LT_INIT comes from libtool 2.4.6.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6.42-b88ce
libtool: and run autoconf again.

我运行aclocal && autoconf && ./configure && make -j4

我再次make,并且收到相同的错误!非常意外...

我开始检查生成的libtool脚本。

# Which release of libtool.m4 was used?
macro_version=2.4.6
macro_revision=2.4.6
...
PROGRAM=libtool
PACKAGE=libtool
VERSION=2.4.6.42-b88ce
package_revision=2.4.6.42

所以问题是这些.42-b88ce.42后缀。它们来自哪里?

我用apt-get重新安装了libtool。

我检查其版本。

dev0@DESKTOP-KK30DO1:~$ apt list --installed | grep libtool

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libtool/stable,now 2.4.6-9 all [installed]

这里我们看到它实际上是2.4.6-9,即后缀-9

好吧...这是怎么回事?这些.42-b88ce.42后缀从何而来?如何解决错误?请帮助了解问题。

P.S。系统信息(uname -a):

Linux DESKTOP-KK30DO1 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-09-20) x86_64 GNU/Linux
libtool
1个回答
0
投票

回复自己。

这些后缀在我要构建的库包中的初始ltmain.sh中。这些后缀的原因很可能是以前的开发人员已从源代码构建了libtool(因此b88ce.42后缀可以是最后一次提交的哈希和补丁号)。

解决方案是通过执行ltmain.sh [1]重新生成libtoolize。请注意,OSX用户应使用glibtoolize(因为OSX有其自己的命令,名称类似libtool)。

最终的构建顺序是:

libtoolize && aclocal && autoconf && automake && ./configure && make -j4

参考:

  1. https://www.gnu.org/software/automake/manual/html_node/Error-required-file-ltmain_002esh-not-found.html
© www.soinside.com 2019 - 2024. All rights reserved.