libtool version mismatch error

mspoerr picture mspoerr · Jun 22, 2010 · Viewed 72.2k times · Source

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?

Answer

ptomato picture ptomato · Jul 8, 2010

Try running

autoreconf --force --install
./configure
make

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; including aclocal.m4, any m4 directory, any autom4te.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 and aclocal.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.