【发布时间】:2012-04-18 12:00:58
【问题描述】:
我在 Ubuntu 10.04 上尝试编译 pcre-8.30.tar.gz 时遇到错误,不知道发生了什么。
ciphor@MyUbuntu:~/work/pcre-8.30$ make
make all-am
make[1]: Entering directory `/home/ciphor/work/pcre-8.30'
CXX pcrecpp.lo
libtool: compile: unrecognized option `-DHAVE_CONFIG_H'
libtool: compile: Try `libtool --help' for more information.
make[1]: *** [pcrecpp.lo] Error 1
make[1]:Leaving directory `/home/ciphor/work/pcre-8.30'
make: *** [all] Error 2
我阅读了 Makefile 并发现以下行:
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
其中 $(DEFS) 是“-DHAVE_CONFIG_H”选项。我猜它是 gcc 的一个选项,而不是 libtool 的一个选项,对吧?
似乎错误就在这里,但是如何解决呢?
【问题讨论】:
-
你能检查一下Makefile中CXX、CXXCPP和ac_ct_CXX的值吗?他们都是
=g++吗?g++安装了吗? -
是的,你是对的,g++没有安装。
-
安装它是否解决了您的问题?如果确实如此,不妨将其作为答案。
-
是的,你解决了我的问题,谢谢:)