报错:Makefile.am:31: Libtool library used but `LIBTOOL’ is undefined

2016年7月27日 | 分类: 【技术】

参考:http://stackoverflow.com/questions/15703522/libtool-library-used-but-libtool-is-undefined

当执行:

autoreconf -i && automake && autoconf

报错:

configure.ac:64: installing './compile'
configure.ac:33: installing './config.guess'
configure.ac:33: installing './config.sub'
configure.ac:39: installing './install-sh'
configure.ac:39: installing './missing'
Makefile.am: installing './INSTALL'
examples/Makefile.am: installing './depcomp'
lib/Makefile.am:32: error: Libtool library used but 'LIBTOOL' is undefined
lib/Makefile.am:32:   The usual way to define 'LIBTOOL' is to add 'LT_INIT'
lib/Makefile.am:32:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
lib/Makefile.am:32:   If 'LT_INIT' is in 'configure.ac', make sure
lib/Makefile.am:32:   its definition is in aclocal's search path.
parallel-tests: installing './test-driver'
autoreconf: automake failed with exit status: 1

办法:

在当前源码目录执行

libtoolize

输出:

libtoolize: putting auxiliary files in '.'.
libtoolize: linking file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: linking file 'm4/libtool.m4'
libtoolize: linking file 'm4/ltoptions.m4'
libtoolize: linking file 'm4/ltsugar.m4'
libtoolize: linking file 'm4/ltversion.m4'
libtoolize: linking file 'm4/lt~obsolete.m4'

再执行autoreconf。