LinuxSir.cn,穿越时空的Linuxsir!

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

crt1.o属于redhat哪个包阿~~

[复制链接]
发表于 2005-8-23 18:36:46 | 显示全部楼层 |阅读模式
在gcc下编程为什么出现这个信息阿~~
[root@localhost zhangqing]# gcc -o test tes.c
/usr/bin/ld: cannot open crt1.o: 没有/usr/bin/ld: cannot open crt1.o: 没有那个文件或目录
collect2: ld returned 1 exit status
还有当我mount上windows下的 盘时为什么以root登陆时查看windows盘时汉字都显十不出来(???? (无效的 Unicode)).而以其他用户登陆时却可以正常
在网站上查了一下,虽有这方面的 问题..但是我还是没有得到正确答案~~新手上路..哪位高手指点一下阿~~
shell显十如下:
[zhangqing@localhost zhangqing]$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
按论坛上的 方法:
[zhangqing@localhost zhangqing]$ gcc -v tes.c
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux
Thread model: posix
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/cc1 -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 tes.c -quiet -dumpbase tes.c -auxbase tes -version -o /tmp/ccMAx5kz.s
GNU C version 3.3.2 20031022 (Red Hat Linux 3.3.2-1) (i386-redhat-linux)
        compiled by GNU C version 3.3.2 20031022 (Red Hat Linux 3.3.2-1).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=31914
ignoring nonexistent directory "/usr/i386-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/include
/usr/include
End of search list.
as -V -Qy -o /tmp/ccg3n2fd.o /tmp/ccMAx5kz.s
GNU assembler version 2.14.90.0.6 (i386-redhat-linux) using BFD version 2.14.90.0.6 20030820
/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/collect2 --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 crt1.o crti.o /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/crtbegin.o -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.2 -L/usr/lib/gcc-lib/i386-redhat-linux/3.3.2/../../.. /tmp/ccg3n2fd.o -lgcc -lgcc_eh -lc -lgcc -lgcc_eh /usr/lib/gcc-lib/i386-redhat-linux/3.3.2/crtend.o crtn.o
/usr/bin/ld: cannot open crt1.o: 没有那个文件或目录
collect2: ld returned 1 exit status
[zhangqing@localhost zhangqing]$ ld -o tes tes.o -lc -dynamic-linker /lib/ld-linux.so.2
ld: cannot find -lc
[zhangqing@localhost zhangqing]$ ld -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o /usr/lib/crti.o -lc tes.o /usr/lib/crtn.o
ld: cannot open /usr/lib/crt1.o: 没有那个文件或目录
还是一样找不到crt1.o文件

tes.c是一个很简单的 测试程序:
main()
{
printf("this is a test file!");
}

求助:怎样才能解决这个问题阿 ~~
 楼主| 发表于 2005-8-23 19:51:44 | 显示全部楼层
hehe ~~~搞定~~
缺了一个glibc_devel包 ,找了一个版本,虽然不匹配,直接给它force了
rpm -i --force --nodeps glibc-devel-2.2.93-5.i386.rpm
现在就能现实结果了
回复 支持 反对

使用道具 举报

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

本版积分规则

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