Search code examples
libtool

libtool: Version mismatch error: 2.4.6 (expected) vs 2.4.6.42-b88ce (actual), aclocal has no effect


On make I get this error:

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.

I run aclocal && autoconf && ./configure && make -j4.

I make again and I get the same error! Very unexpected...

I started examining generated libtool script.

# 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

So the issue is these .42-b88ce and .42 suffixes. Where do they come from?

I re-installed libtool with apt-get.

I check its version.

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]

Here we see that it is actually 2.4.6-9, i.e. with -9 suffix.

Okay... What is going on here? Where do these .42-b88ce and .42 suffixes come from? How to solve the error? Please help to understand the issue.

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

Solution

  • Replying to myself.

    These suffixes were in the initial ltmain.sh distributed within the library package that I'm trying to build. The reason of these suffixes is likely that the previous developer have built libtool from the source code (so b88ce and .42 suffixes can be the hash of the last commit and the patch number).

    The solution is to re-generate ltmain.sh by executing libtoolize [1]. Please note that OSX users should use glibtoolize (since OSX has its own command with the similar name libtool).

    The final build sequence is:

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

    References:

    1. https://www.gnu.org/software/automake/manual/html_node/Error-required-file-ltmain_002esh-not-found.html