error: Libtool library used but 'LIBTOOL' is undefined
执行configure遇到这个错误,这是个突然出现的错误,之前相同的代码执行configure时没有出错,Libtool 是安装了的。这到底是什么原因呢?
相关错误输出:
Makefile.am:26: error: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:26: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:26: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:26: If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:26: its definition is in aclocal's search path.
ERROR: autogen.sh failed, autogen is incomplete
./libtool: line 1290: func_opt_split: command not found
libtool: Version mismatch error. This is libtool 2.2.6b, 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.2.6b
libtool: and run autoconf again.
make[1]: *** [libpng14_la-png.lo] Error 63
make[1]: Leaving directory `/opt/libpng-1.4.22'
make: *** [all] Error 2
# autoconf
configure.ac:38: error: possibly undefined macro: AC_PROG_LD
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
# automake --add-missing
Makefile.am:26: error: Libtool library used but 'LIBTOOL' is undefinederror: Libtool library used but 'LIBTOOL' is undefined
Makefile.am:26: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
Makefile.am:26: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
Makefile.am:26: If 'LT_INIT' is in 'configure.ac', make sure
Makefile.am:26: its definition is in aclocal's search path.
发生错误原因?
环境:contos6,php5.6,
最近在研究着让php支持avif转png的功能,由于先前安装的libpng1.6.x版本都带有iCCP警告,导致调用时转换失败,所以在编译安装低版本libpng前就先到高版本的源码目录下执行了一下“make uninstall”,难道就是因为这个命令导致的错误?
奇怪,libpng 所有版本的源码都出现这个问题了。
解决方法
也是怪了,把源码删除,然后重新解压,再执行 configure,make,make install 竟然一切顺利!
相关参考
error: Libtool library used but 'LIBTOOL' is undefined
Libtool library used but `LIBTOOL' is undefined?
本文由 微wx笑 创作,采用 署名-非商业性使用-相同方式共享 4.0 许可协议,转载请附上原文出处链接及本声明。
原文链接:https://www.ivu4e.cn/blog/service/2022-05-05/1199.html