今天想用一下 zookeeper API,结果编译的时候遇到以下问题。
1.问题1
问题描述
执行完 configure,然后开始编译 make,结果抛出一下错误信息。
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
make all-am
make[1]: Entering directory `/home/zk/opt/zookeeper/server2/zookeeper-3.3.6/src/c'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I./include -I./tests -I./generated -Wall -Werror -g -O2 -D_GNU_SOURCE -MT zookeeper.lo -MD -MP -MF .deps/zookeeper.Tpo -c -o zookeeper.lo `test -f 'src/zookeeper.c' || echo './'`src/zookeeper.c
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.2.6b.
libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1ubuntu1
libtool: and run autoconf again.
make[1]: *** [zookeeper.lo] Error 63
make[1]: Leaving directory `/home/zk/opt/zookeeper/server2/zookeeper-3.3.6/src/c'
make: *** [all] Error 2
问题原因
因为 configure 文件不适用于当前系统环境。
问题解决
重新生成 configue 文件
[zk@test-server c]$ autoreconf -ivf
autoreconf: Entering directory `.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force
autoreconf: configure.ac: tracing
aclocal.m4:16: warning: this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf --force
aclocal.m4:16: warning: this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
autoreconf: running: /usr/bin/autoheader --force
aclocal.m4:16: warning: this file was generated for autoconf 2.68.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
autoreconf: running: automake --add-missing --copy --force-missing
autoreconf: Leaving directory `.'
[zk@test-server c]$
2.问题2
问题描述
执行configure 的时候 抛出以下错误。
./configure: line 4623: ` AM_PATH_CPPUNIT(1.10.2)'
问题原因
同上 【问题1】
问题解决
同上【问题1】