【问题标题】:libtool: Version mismatch error: 2.4.6 (expected) vs 2.4.6.42-b88ce (actual), aclocal has no effectlibtool: Version mismatch error: 2.4.6 (expected) vs 2.4.6.42-b88ce (actual), aclocal 没有效果
【发布时间】:2019-10-25 21:08:57
【问题描述】:

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 后缀从何而来?如何解决错误?请帮助理解问题。

附:系统信息(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

【问题讨论】:

  • 我已回滚您的编辑。在标题中添加 [SOLVED] 或将解决方案编辑到您的问题中是不合适的。如果您找到了想要分享的解决方案,请在下方为此目的提供的空白处写下答案。请参阅Can I answer my own question? 了解更多信息。如果您不想写答案,您可以使用标签下方的链接删除问题,或者将问题保持原样,让其他人回答。

标签: libtool


【解决方案1】:

回复我自己。

这些后缀位于最初的ltmain.sh 中,分布在我正在尝试构建的库包中。出现这些后缀的原因很可能是之前的开发者从源码中构建了libtool(所以b88ce.42后缀可以是最后一次提交的hash和补丁号)。

解决方法是通过执行libtoolize[1]重新生成ltmain.sh。请注意,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

【讨论】:

  • 作为侧节点,你应该先删除原来的ltmain.sh,因为它不会被覆盖。
猜你喜欢
  • 2014-12-11
  • 2014-03-09
  • 2022-12-02
  • 1970-01-01
  • 2020-03-04
  • 2020-12-19
  • 2023-02-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多