libtool版本不匹配错误
在 Ubuntu 10.04 上使用 kdevelop 3.5 构建应用程序时,出现以下错误:
libtool: Version mismatch error. This is libtool 2.2.6 Debian-2.2.6a-4, but the
libtool: definition of this LT_INIT comes from libtool 2.2.6b.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 Debian-2.2.6a-4
libtool: and run autoconf again.
make[2]: *** [wktools4] Error 63
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***
Wherecan I get the required version of libtool, or how can I recreate aclocal.m4?
When building my application with kdevelop 3.5 on Ubuntu 10.04, I get the following errors:
libtool: Version mismatch error. This is libtool 2.2.6 Debian-2.2.6a-4, but the
libtool: definition of this LT_INIT comes from libtool 2.2.6b.
libtool: You should recreate aclocal.m4 with macros from libtool 2.2.6 Debian-2.2.6a-4
libtool: and run autoconf again.
make[2]: *** [wktools4] Error 63
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***
Where can I get the needed version of libtool, or how can I recreate aclocal.m4?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
尝试
在项目的根目录中运行。
如果这不起作用,请尝试先运行
makemaintainer-clean
,然后转到步骤 1。如果仍然不起作用,请运行
makemaintainer-clean
,然后删除项目根目录中所有生成的文件;包括aclocal.m4、任何m4目录、autom4te.cache目录、configure、Makefile。在、config.h
、config.h.in
、config.status
、libtool
、ltmain.sh
等。然后转到步骤 1。为什么有效:
libtool
和aclocal.m4
是这两个文件都是由您的构建系统生成的。如果它们不同步(由不同版本的构建工具生成),则会出现此错误。通常这种情况不会发生,但是当您将生成的文件签入源代码管理时,可能会导致这种情况。该解决方案的作用是删除并重新生成所有自动生成的文件。一旦它们被删除并重新生成,它们就不会再不同步了。
Try running
in the root directory of your project.
If that doesn't work, try running
make maintainer-clean
first and then go to step 1.If that still doesn't work, run
make maintainer-clean
, then delete every generated file in the root directory of your project; includingaclocal.m4
, anym4
directory, anyautom4te.cache
directory,configure
,Makefile.in
,config.h
,config.h.in
,config.status
,libtool
,ltmain.sh
, etc. Then go to step 1.Why this works:
libtool
andaclocal.m4
are both files that are generated by your build system. If they are out of sync (generated by different versions of the build tools), then you get this error. Normally that shouldn't happen, but an example of something that can cause it is when you check in generated files to source control.What this solution does is delete and regenerate all the autogenerated files. Once they're erased and regenerated, they can't be out of sync anymore.
如果您使用的是 Anaconda,那么这可能是由于来自不同来源的 libtool 和 autoconf 造成的。您可以通过执行
which libtool
which autoconf
来检查这一点。我的 libtool 来自 conda,而 autoconf 是一个系统包。卸载 autoconf 并使用 conda
apt remove -y autoconf 再次安装 (Ubuntu/Debian)
conda install -c anaconda autoconf
注意:您可能还需要安装 automake。
conda install -c anaconda automake
If you are using Anaconda, then this could be due to libtool and autoconf from different sources. You can check this by executing
which libtool
which autoconf
My libtool was from conda and autoconf was a system package. Uninstalled autoconf and installed it again using conda
apt remove -y autoconf
(Ubuntu/Debian)conda install -c anaconda autoconf
Note: You may need to install automake too.
conda install -c anaconda automake
尝试
-i
选项很重要。Try
The
-i
option is important.也许您安装了两个不同版本的libtools。尝试
apt-get删除所有
(直到在命令行中输入which libtool
时什么也得不到),然后apt-get install
你喜欢的那个。maybe you have installed two libtools of different version. Try to
apt-get remove all
(until you get nothing, when you typewhich libtool
in the command line), thenapt-get install
the one you like.尝试运行 aclocal
Try running aclocal
我解决了卸载系统的 libtool 并从上游安装的问题: git clone git://git.savannah.gnu.org/libtool.git
I solve that uninstalling system's libtool and installing from upstream: git clone git://git.savannah.gnu.org/libtool.git
以上均无效。
然后这起作用了:
None of the above worked.
Then this worked:
以上均无效。在我停用 conda 环境后,它起作用了:
source deactivate
None of the above worked. After I deactivated the conda environment, it worked:
source deactivate
我也遇到这个问题。就我而言,在 ./autogen.sh 的输出中,有:
libtoolize: 您应该将以下文件的内容添加到 'aclocal.m4': libtoolize: '/aclocal/libtool.m4' libtoolize: '/aclocal /ltoptions.m4' libtoolize: '/aclocal/ltversion.m4' libtoolize: 考虑将 'AC_CONFIG_MACRO_DIRS([m4])' 添加到 configure.ac、libtoolize: 并重新运行 libtoolize 和 aclocal。 libtoolize:考虑将“-I m4”添加到 Makefile.am 中的 ACLOCAL_AMFLAGS。
我只是将 /aclocal/ 下的三个 *.m4 文件的内容附加到 aclocal.m4 文件中:
然后 make。
I also encounter this issue. In my case, in the output of ./autogen.sh, there is:
libtoolize: You should add the contents of the following files to 'aclocal.m4': libtoolize: '/aclocal/libtool.m4' libtoolize: '/aclocal/ltoptions.m4' libtoolize: '/aclocal/ltversion.m4' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
I just append the content the three *.m4 files under /aclocal/ to the aclocal.m4 file:
then make.
这是错误:
以上都不起作用。
然后这起作用了:
here is the error:
None of the above worked.
Then this worked:
我还为 autoconf 和 autoreconf 使用自定义包含目录,例如
autoreconf -I ./m4
。因此,过时的ltversion.m4
意外地出现在其中一个自定义包含内容中。这在这里导致了完全相同的错误。我通过删除过时的 ltversion.m4 文件解决了这个问题。I also use custom include directories for autoconf and autoreconf, like
autoreconf -I ./m4
. So it happened that an outdatedltversion.m4
accidentially was sitting inside one of those custom includes. This caused exactly the same error here. I solved it by removing the outdatedltversion.m4
file.