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

标签 libtool

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

最佳答案

回复我自己。

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

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

关于libtool:版本不匹配错误:2.4.6(预期)与 2.4.6.42-b88ce(实际),aclocal 无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58565768/

相关文章:

windows - 如何在 cygwin 中安装 libtoolize?

ios - 将目标添加到已添加子库的库中

c++ - 如何告诉 Libtool 使用 C++ 而不是 C?

autotools - LDFLAGS 在带有 libtool 的自动工具中的使用

doxygen - 使用 autotools 生成(并安装)doxygen 文档

xcode - MacBook 上的 glibtool

gdb - 整个程序中库的调试符号缺少行号,但不是单独的

macos - LTLIBRARIES : mv *. Tpo *.Plo,但前者不存在,后者已经存在

c++ - dynamic_cast 由 lt_dlopen(libtool) 加载的共享库中的接口(interface)不起作用

c++ - 非标准 C++ 后缀的自动依赖跟踪