主题 : 菜鸟求助:为什么编译不过去?? 复制链接 | 浏览器收藏 | 打印
保护自己的梦想
级别: 新手上路
UID: 7883
精华: 1
发帖: 22
金钱: 250 两
威望: 240 点
综合积分: 64 分
注册时间: 2009-08-01
最后登录: 2009-11-02
楼主  发表于: 2009-08-01 19:07

 菜鸟求助:为什么编译不过去??

我编写了一个简单的hello world 程序,makefile也写了
但是make后出现这样的错误,是怎么回事??

arm-elf-gcc   -static  hello.c   -o hello
/usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.text+0xc4): In functio n `__do_global_ctors':
: undefined reference to `__CTOR_LIST__'
/usr/local/lib/gcc-lib/arm-elf/2.95.3/libgcc.a(__main.o)(.data+0x0): undefined r eference to `__DTOR_LIST__'
collect2: ld returned 1 exit status
make: *** [hello] 错误? 1


ps:自己装了个arm-elf-gcc2.95.3,不知道怎么会编译不过去,如何设置,请高手指点,谢谢!!
有梦想就要去追逐,只管风雨兼程!!
http://hi.baidu.com/kissky2009/blog
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2009-08-01 21:03
你一定要用-static静态编译?加上-lgcc -lc试试?
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
保护自己的梦想
级别: 新手上路
UID: 7883
精华: 1
发帖: 22
金钱: 250 两
威望: 240 点
综合积分: 64 分
注册时间: 2009-08-01
最后登录: 2009-11-02
2楼  发表于: 2009-08-01 22:23

 回 1楼(kasim) 的帖子

还是不行,同样的错误啊,是不是arm-elf-gcc2.95.3只能编译uclinux
有梦想就要去追逐,只管风雨兼程!!
http://hi.baidu.com/kissky2009/blog
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
3楼  发表于: 2009-08-02 11:08

 Re:回 1楼(kasim) 的帖子

引用第2楼zhuimengcany于2009-08-01 22:23发表的 回 1楼(kasim) 的帖子 :
还是不行,同样的错误啊,是不是arm-elf-gcc2.95.3只能编译uclinux

一般来讲arm-elf用于uCLinux, arm-linux用于带有MMU的嵌入式Linux。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
保护自己的梦想
级别: 新手上路
UID: 7883
精华: 1
发帖: 22
金钱: 250 两
威望: 240 点
综合积分: 64 分
注册时间: 2009-08-01
最后登录: 2009-11-02
4楼  发表于: 2009-08-02 12:09

 回 3楼(kasim) 的帖子

谢谢BZ的解答,我会好好学习的
有梦想就要去追逐,只管风雨兼程!!
http://hi.baidu.com/kissky2009/blog