LinuxSir.cn,穿越时空的Linuxsir!

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

请问cannot run C compiled programs 怎么解决?

[复制链接]
发表于 2006-4-8 21:55:21 | 显示全部楼层 |阅读模式
我在debian sarge 3.1 下编译LFS6.1.1,第一个包就不能编译。怎么办。

lfs@zyldebian:/mnt/lfs/sources/binutils-build$ make
Configuring in libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo
checking for perl... perl
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled  programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [configure-libiberty] Error 1
发表于 2006-4-8 23:04:09 | 显示全部楼层
看看 config.log 里边有什么错误?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-9 14:41:31 | 显示全部楼层
config.log 中的最后部分是:

configure:4251: checking for i686-pc-linux-gnu-ar
configure:4284: checking for ar
configure:4323: checking for i686-pc-linux-gnu-as
configure:4356: checking for as
configure:4395: checking for i686-pc-linux-gnu-dlltool
configure:4428: checking for dlltool
configure:4467: checking for i686-pc-linux-gnu-ld
configure:4500: checking for ld
configure:4539: checking for i686-pc-linux-gnu-nm
configure:4572: checking for nm
configure:4611: checking for i686-pc-linux-gnu-ranlib
configure:4644: checking for ranlib
configure:4683: checking for i686-pc-linux-gnu-windres
configure:4716: checking for windres
configure:4801: checking whether to enable maintainer-specific portions of Makef iles
configure:4848: checking if symbolic links between directories work
回复 支持 反对

使用道具 举报

发表于 2006-4-9 15:26:25 | 显示全部楼层
会不会是主系统里面的头文件没有安装?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-4-10 02:06:17 | 显示全部楼层
找到原因了,我在第一遍的时候忘了用lfs登陆编译,结果用root编译,编译到5.7时,检查错误,于是
我将文件全部删除,用lfs重新编译,结果就提示以上的错误了,应该是用root编译时将gcc弄错乱了。

我重新装了一遍debian,现在可以编译了。

现在我已经将第五章编译完了,编译第六章时,chroot可以,可是在新的环境里,bash下只能处理一条命令,然后就死了,可以输入内容并回显,可是不能有下一个提示行,等了很久都不出来。
重新chroot,又可以执行一条命令,不知是不是第五章时编译bash有问题,可是编译第五章的bash时,并没有提示任何错误。
回复 支持 反对

使用道具 举报

发表于 2006-4-10 02:26:06 | 显示全部楼层
似乎总是有人碰到这个问题,但是我一次都没碰到过。不知道谁知道解决方法呢。。。
回复 支持 反对

使用道具 举报

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

本版积分规则

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