在编译一个软件的时候,在 ./configure 和 make 之后可能会出现如下错误:
- libtool: Version mismatch error. This is libtool 2.4.2 Debian-2.4.2-1ubuntu1, but the
- libtool: definition of this LT_INIT comes from libtool 2.4.
- libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1ubuntu1
- libtool: and run autoconf again.
- make[5]: *** 1 Error 63
解决方法很简单:
运行 autoreconf -ivf 即可。
参考:http://www.compdigitec.com/labs/2012/10/18/solving-libtool-version-mismatch-error/
make install fails with:
quiet_libtool: link: gcc -I/usr/local/src/freeswitch-1.0.6/src/include -I/usr/local/src/freeswitch-1.0.6/src/include -I/usr/local/src/freeswitch-1.0.6/libs/libteletone/src -fPIC -Werror -fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1 -g -ggdb -Wall -std=c99 -pedantic -Wdeclaration-after-statement -g -O2 -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/local/src/freeswitch-1.0.6/libs/apr/include -I/usr/local/src/freeswitch-1.0.6/libs/apr-util/include -I/usr/local/src/freeswitch-1.0.6/libs/apr-util/xml/expat/lib -I/usr/local/src/freeswitch-1.0.6/libs/stfu -I/usr/local/src/freeswitch-1.0.6/libs/sqlite -I/usr/local/src/freeswitch-1.0.6/libs/pcre -I/usr/local/src/freeswitch-1.0.6/libs/speex/include -Ilibs/speex/include -I/usr/local/src/freeswitch-1.0.6/libs/srtp/include -I/usr/local/src/freeswitch-1.0.6/libs/srtp/crypto/include -Ilibs/srtp/crypto/include -I/usr/local/src/freeswitch-1.0.6/libs/libedit/src -DSWITCH_HAVE_LIBEDIT -Ilibs/libedit/src -DSWITCH_HAVE_LIBEDIT -g -O2 -o .libs/freeswitch freeswitch-switch.o -lm ./.libs/libfreeswitch.so -L/usr/local/src/freeswitch-1.0.6/libs/apr-util/xml/expat/lib -L/usr/lib64 /usr/local/src/freeswitch-1.0.6/libs/apr-util/xml/expat/lib/.libs/libexpat.a /usr/local/src/freeswitch-1.0.6/libs/apr/.libs/libapr-1.a -lpq libs/apr/.libs/libapr-1.a -lrt -lcrypt -lpthread libs/libedit/src/.libs/libedit.a -lssl -lcrypto -ldl -lz -lncurses -pthread -Wl,-rpath -Wl,/usr/local/freeswitch/lib
/usr/lib64/libnss3.so: undefined reference to `PR_FindSymbol'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Rlock'
/usr/lib64/libssl3.so: undefined reference to `PR_OpenAnonFileMap'
/usr/lib64/libssl3.so: undefined reference to `PR_UnloadLibrary'
/usr/lib64/libnss3.so: undefined reference to `PL_InitArenaPool'
/usr/lib64/libnss3.so: undefined reference to `PR_NewRWLock'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Wlock'
/usr/lib64/libnss3.so: undefined reference to `PR_LoadLibrary'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_GetEnv'
/usr/lib64/libssl3.so: undefined reference to `PR_LoadLibraryWithFlags'
/usr/lib64/libnssutil3.so: undefined reference to `PL_ClearArenaPool'
/usr/lib64/libnss3.so: undefined reference to `PR_DestroyRWLock'
/usr/lib64/libnss3.so: undefined reference to `PR_NewTCPSocket'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_SetEnv'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_GetLibraryName'
/usr/lib64/libssl3.so: undefined reference to `PR_ExportFileMapAsString'
/usr/lib64/libssl3.so: undefined reference to `PR_GetLibraryFilePathname'
/usr/lib64/libssl3.so: undefined reference to `PR_FindFunctionSymbol'
/usr/lib64/libnss3.so: undefined reference to `PL_NewHashTable'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_ErrorToString'
/usr/lib64/libnss3.so: undefined reference to `PR_RWLock_Unlock'
/usr/lib64/libssl3.so: undefined reference to `PR_ImportFileMapFromString'
/lib64/libldap_r-2.4.so.2: undefined reference to `PR_GetDirectorySeparator'
collect2: ld returned 1 exit status
make[1]: *** [freeswitch] Error 1
make: *** [install] Error 2
solution:
diff --git a/configure.in b/configure.in index 9599c26..fbb9ccf 100644 --- a/configure.in +++ b/configure.in @@ -414,6 +414,17 @@ if test "x$have_libresolv" = "xyes" ; then APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv) fi +AC_CHECK_LIB(nspr4, PR_Initialize, have_nspr4=yes, have_nspr4=no) +if test "x$have_nspr4" = "xyes" ; then +APR_ADDTO(SWITCH_AM_LDFLAGS, -lnspr4) +fi + +AC_CHECK_LIB(plds4, PL_NewHashTable, have_plds4=yes, have_plds4=no) +if test "x$have_plds4" = "xyes" ; then +APR_ADDTO(SWITCH_AM_LDFLAGS, -lplds4) +fi + + ESL_LDFLAGS= PLATFORM_CORE_LDFLAGS= PLATFORM_CORE_LIBS=