LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1731|回复: 2

gcc-4.1.2编译出现问题,

[复制链接]
发表于 2008-3-18 23:52:52 | 显示全部楼层 |阅读模式
[root@localhost gcc-4.1.2]# make
make[1]: Entering directory `/home/fujk/gcc/gcc-4.1.2'
Configuring in host-i686-pc-linux-gnu/fastjar
configure: loading cache ./config.cache
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for a BSD-compatible install... /usr/bin/install -c
checking for rm... /bin/rm
checking for cp... /bin/cp
checking for strip... /usr/bin/strip
checking for chmod... /bin/chmod
checking whether to enable maintainer-specific portions of Makefiles... no
checking for dirent.h that defines DIR... no
checking for sys/ndir.h that defines DIR... no
checking for sys/dir.h that defines DIR... no
checking for ndir.h that defines DIR... no
checking for library containing opendir... none required
checking how to run the C preprocessor... /lib/cpp
configure: error: C preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[1]: *** [configure-fastjar] 错误 1
make[1]: Leaving directory `/home/fujk/gcc/gcc-4.1.2'
make: *** [all] 错误 2
可以这几个文件我都有。
[root@localhost gcc-4.1.2]# locate dirent.h
/lib/modules/2.6.9-1.667smp/build/include/linux/dirent.h
/lib/modules/2.6.9-1.667/build/include/linux/dirent.h
/usr/include/bits/dirent.h
/usr/include/linux_bak/dirent.h
/usr/include/dirent.h
/usr/src/linux-2.6.24.3/include/linux/dirent.h
/usr/lib/bcc/include/dirent.h
/usr/lib/dietlibc/include/dirent.h
/usr/share/man/man0p/dirent.h.0p.gz
/usr/share/doc/HTML/en/kdevelop/reference/C/CONTRIB/SNIP/dirent.h
/usr/share/apps/quanta/doc/php/streams.struct-php-stream-dirent.html
[root@localhost gcc-4.1.2]# locate /lib/cpp
/lib/cpp
环境变量是这样的:
[root@localhost gcc-4.1.2]# export
declare -x DISPLAY="localhost:10.0"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTSIZE="1000"
declare -x HOME="/root"
declare -x HOSTNAME="localhost.localdomain"
declare -x INPUTRC="/etc/inputrc"
declare -x KDEDIR="/usr"
declare -x LANG="zh_CN.UTF-8"
declare -x LESSOPEN="|/usr/bin/lesspipe.sh %s"
declare -x LOGNAME="root"
declare -x LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01r=01;05;37;41:mi=01;05;37;41:ex=01;32:*.cmd=01;32:*.exe=01;32:*.com=01;32:*.btm=01;32:*.bat=01;32:*.sh=01;32:*.csh=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tz=01;31:*.rpm=01;31:*.cpio=01;31:*.jpg=01;35:*.gif=01;35:*.bmp=01;35:*.xbm=01;35:*.xpm=01;35:*.png=01;35:*.tif=01;35:"
declare -x MAIL="/var/spool/mail/root"
declare -x OLDPWD="/home/fujk/gcc/gcc-4.1.2.config"
declare -x PATH="/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin"
declare -x PKG_CONFIG_PATH="/usr/lib/pkgconfig"
declare -x PWD="/home/fujk/gcc/gcc-4.1.2"
declare -x QTDIR="/usr/lib/qt-3.3"
declare -x SHELL="/bin/bash"
declare -x SHLVL="1"
declare -x SSH_ASKPASS="/usr/libexec/openssh/gnome-ssh-askpass"
declare -x SSH_CLIENT="::ffff:116.77.0.12 2369 22"
declare -x SSH_CONNECTION="::ffff:116.77.0.12 2369 ::ffff:116.77.0.13 22"
declare -x SSH_TTY="/dev/pts/3"
declare -x TERM="vt100"
declare -x USER="root


前一个帖子:
内核执行 make menuconfig 以后出现如下提示,版本是从www.kernel.org下载最新的。
[root@localhost linux-2.6.24.3]# make menuconfig
  HOSTCC  scripts/basic/fixdep
In file included from /usr/include/bits/posix1_lim.h:153,
                 from /usr/include/limits.h:144,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.2/include/limits.h:122,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.2/include/syslimits.h:7,
                 from /usr/lib/gcc/i386-redhat-linux/3.4.2/include/limits.h:11,
                 from scripts/basic/fixdep.c:115:
/usr/include/bits/local_lim.h:36:26: linux/limits.h: 没有那个文件或目录
In file included from /usr/include/sys/socket.h:35,
                 from /usr/include/netinet/in.h:24,
                 from /usr/include/arpa/inet.h:23,
                 from scripts/basic/fixdep.c:117:
/usr/include/bits/socket.h:304:24: asm/socket.h: 没有那个文件或目录
scripts/basic/fixdep.c: In function `use_config':
scripts/basic/fixdep.c:206: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:206: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:206: error: for each function it appears in.)
scripts/basic/fixdep.c:206: warning: unused variable `s'
scripts/basic/fixdep.c: In function `parse_dep_file':
scripts/basic/fixdep.c:306: error: `PATH_MAX' undeclared (first use in this function)
scripts/basic/fixdep.c:306: warning: unused variable `s'
make[1]: *** [scripts/basic/fixdep] 错误 1
make: *** [scripts_basic] 错误 2
[root@localhost linux-2.6.24.3]#
发表于 2008-3-19 01:38:53 | 显示全部楼层
你的GCC版本太老了吧,试试 4.1.2 吧,公认稳定的版本。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-3-19 23:02:08 | 显示全部楼层
编译出现的两个问题都已经解决,是由于没有安装kernel-headers这个包的缘故。
这个算BUG吗,是刚装的系统。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表