libtool version mismatch error

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.


Try

autoreconf -i

The -i option is important.


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