LinuxSir.cn,穿越时空的Linuxsir!

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

新手遇到的奇怪问题

[复制链接]
发表于 2008-10-28 22:39:40 | 显示全部楼层 |阅读模式
小弟在fedora9下面做lfs6.2,第一次编译gcc的时候就碰到问题了,配置的时候出现下面错误。google了一天没解决,有人说是缺少libc6-dev,可是找不到rpm包,yum也不行,还有人说libc6-dev就是glibc,还是装不起来。

lfs:/mnt/lfs/sources/gcc-4.0.3$ cd gcc-build/
lfs:/mnt/lfs/sources/gcc-4.0.3/gcc-build$ /mnt/lfs/sources/gcc-4.0.3/configure --prefix=/tools --with-local-prefix=/tools --disable-nls --enable-shared --enable-languages=c
creating cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... /usr/bin/install -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.

最后又发现个奇怪的现象,我重新回去配置binutils竟然出现了跟配置gcc一样的错误,真是糊涂了,还请大虾们指点啊。。。

lfs:/mnt/lfs/sources/gcc-4.0.3$ cd /mnt/lfs/sources/binutils-2.16.1/binutils-build
lfs:/mnt/lfs/sources/binutils-2.16.1/binutils-build$ /mnt/lfs/sources/binutils-2.16.1/configure --prefix=/tools --disable-nls
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
发表于 2008-10-28 23:05:03 | 显示全部楼层
当初我在redhat 9下面安装 vmware tool就遇到了这个问题
----编译环境没有就绪
后来发现ubuntu默认也没有装libc6-dev

我知道的是ubuntu可以apt-get搞定
我想你的FC9应该也可以yum得到吧
期待楼下 给出具体指令
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-28 23:12:52 | 显示全部楼层
我yum过了,还添了几个源,libc6-dev是完全不行,后来yum了glibc,安装的时候出错了。。。
网上只能下到libc6-dev.xxx.deb,那个东西fedora装不了,有个alien的好像是,可以转换成rpm格式,免安装的还挺开心,可是一用就出问题,我哭了,而且据说那个转出来的会有问题。
回复 支持 反对

使用道具 举报

发表于 2008-10-29 13:39:09 | 显示全部楼层
我也认为是glibc的问题,还有LZ你用的GCC是什么版本的啊?

我之前听说,用高版本的GCC编译底版本的比如4.XX编译3.XX的时候可能出错的。

不知道是不是这个原因。呼。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-29 13:48:27 | 显示全部楼层
小弟终于发现问题了,gcc和lib都没有问题,问题是在 PATH="/tools/bin:/bin:/usr/bin"
我现在还处于第一次编译binutils,还没有安装glibc,可是PATH却指向了/tools/bin,它底下的ld是连接到/tools/lib的,这时候的lib还所空的,所以会出现这样到问题。
我把/tools/bin从PATH中去掉了,gcc已配置成功,后面应该不会有什么问题吧。
回复 支持 反对

使用道具 举报

发表于 2008-10-29 19:27:28 | 显示全部楼层
Post by chenda0.03;1900761
我yum过了,还添了几个源,libc6-dev是完全不行,后来yum了glibc,安装的时候出错了。。。
网上只能下到libc6-dev.xxx.deb,那个东西fedora装不了,有个alien的好像是,可以转换成rpm格式,免安装的还挺开心,可是一用就出问题,我哭了,而且据说那个转出来的会有问题。
既然是 Fedora 系统就不要去抓 deb 包来用,不一定兼容的!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-29 19:59:49 | 显示全部楼层
恩知道了,谢谢指教,第一次做LFS还真不容易,特别是不在lfslivecd下做,不过能学到不少东西。
回复 支持 反对

使用道具 举报

发表于 2008-10-29 20:03:33 | 显示全部楼层
LFS 手册是给你内功心法的秘笈,请务必详细阅读之,它给你的远比你敲敲命令带来的多,加油吧!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-10-29 22:04:21 | 显示全部楼层
跟linux真是相见恨晚了,不过我也才22而已。
今天解决了不少问题,昨天那股怨气一下子全没了,发现久违了windows,切换之,
随后改QQ签名:linux下的挫折和成长,让我痛苦若狂,欣喜更狂!
回复 支持 反对

使用道具 举报

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

本版积分规则

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