在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. System info (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
发布于 2019-10-26 00:14:20
回答我自己。
这些后缀位于我试图构建的库包中分发的初始ltmain.sh
中。出现这些后缀的原因可能是前面的开发人员已经从源代码构建了libtool
(因此b88ce
和.42
后缀可以是最后一次提交的哈希和补丁号)。
解决方案是通过执行ltmain.sh
1重新生成libtoolize
。请注意,OSX用户应该使用glibtoolize
(因为OSX有自己的命令,名称类似于libtool
)。
最后的构建顺序是:
libtoolize && aclocal && autoconf && automake && ./configure && make -j4
参考文献:
https://stackoverflow.com/questions/58565768
复制相似问题