日期:2014-05-16  浏览次数:20721 次

关于安装NAGIOS之前的问题
大家好,
本人最近正在安装NAGIOS,在执行开始的编译过程中(./configure –prefix=/usr/local/nagios ),到这里就无法进行下去了,报的错误是C preprocessor "/lib/cpp" fails sanity check,See 'config.log' for more details.

通过GOOGLE查找了很多资料,也花费了不少的时间,但是还是没有解决,试试看到网上写没有安装gcc,gcc c++, glib等,太多了,我也记不清楚了,反正是基本上我都安装了,可是结果还是报以上的错误。为了便于大家分析我把CONFIG.LOG贴出来,请大家帮我分析一下好吗?谢谢各位高手了,没办法,我实在是找不到解决办法才到论坛里面求救的。(由于字数的限制,我把部分错误贴出来了)


configure:2224: $? = 0
configure:2227: test -s conftest.o
configure:2230: $? = 0
configure:2248: result: none needed
configure:2266: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
configure:2272: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:2405: checking whether make sets $(MAKE)
configure:2425: result: yes
configure:2436: checking for strip
configure:2454: found /usr/bin/strip
configure:2467: result: /usr/bin/strip
configure:2481: checking how to run the C preprocessor
configure:2516: gcc -E conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
  from /usr/include/limits.h:145,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/limits.h:122,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/syslimits.h:7,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/limits.h:11,
  from conftest.c:10:
/usr/include/bits/local_lim.h:36:26: error: linux/limits.h: No such file or directory
configure:2522: $? = 1
configure: failed program was:
| /* confdefs.h. */

| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:2516: gcc -E conftest.c
In file included from /usr/include/bits/posix1_lim.h:153,
  from /usr/include/limits.h:145,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/limits.h:122,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/syslimits.h:7,
  from /usr/lib/gcc/i386-redhat-linux/4.1.2/include/limits.h:11,
  from conftest.c:10:
/usr/include/bits/local_lim.h:36:26: error: linux/limits.h: No such file or directory
configure:2522: $? = 1
configure: failed program was:
| /* confdefs.h. */

| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:2516: gcc -E -traditional-cpp conftest.c
In file included from /usr/include/features.h:336,
  from /usr/include/assert.h:38,
  from conftest.c:13:
/usr/include/sys/cdefs.h:32: error: #error "You need a ISO C conforming compiler to use the glibc headers"
configure:2522: $? = 1
configure: failed program was:
| /* confdefs.h. */

| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h><