当使用configure和makefile编译项目时,出现如下报错:

libtool: Version mismatch error. This is libtool 2.4.6, but the``
libtool: definition of this LT_INIT comes from libtool 2.4.7.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.6
libtool: and run autoconf again.

网上查了解决方案都是执行autoreconf -fiv,但这个方案对我不管用。尝试修改libtool文件内的版本号,但是执行make后这个版本号依然会被改回2.4.7导致报错。
最后研究了一下libtool,觉得还是应该匹配一下libtool的版本。
首先找到了一个基于libtool的开源项目,用那里面的相关文件替换了m4/的文件内容。开源项目地址如下,将其中m4/文件夹内的所有文件完整复制过来。

https://github.com/yarosla/nxweb

然后重新安装了一下libtool,重新安装的方法在这里:

https://blog.csdn.net/BurningSilence/article/details/113365496

安装完后,执行如下语句,即可继续执行configure和make完成编译。

$ aclocal
$ libtoolize
$ autoheader
$ automake --add-missing
$ autoconf