2013-04-09 204 views
0

下面是我输入的命令及其吐出的内容:不幸的是,谷歌并没有太大的帮助,但我尝试了几件事(从我非常初学者的知识),我一直没有能够解决它。ARM GCC编译错误(Windows 7)

C:\Users\Z\workspace\TEST\src>gcc main.c 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-exit.o): In function `exit': 

exit.c:(.text.exit+0x2c): undefined reference to `_exit' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-sbrkr.o): In function `_sbrk_r': 

sbrkr.c:(.text._sbrk_r+0x18): undefined reference to `_sbrk' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-writer.o): In function `_write_r': 

writer.c:(.text._write_r+0x20): undefined reference to `_write' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-closer.o): In function `_close_r': 

closer.c:(.text._close_r+0x18): undefined reference to `_close' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-fstatr.o): In function `_fstat_r': 

fstatr.c:(.text._fstat_r+0x1c): undefined reference to `_fstat' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-isattyr.o): In function ` 
_isatty_r': 

isattyr.c:(.text._isatty_r+0x18): undefined reference to `_isatty' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-lseekr.o): In function `_lseek_r': 

lseekr.c:(.text._lseek_r+0x20): undefined reference to `_lseek' 
c:/program files (x86)/gnu tools arm embedded/4.7 2013q1/bin/../lib/gcc/arm-none 
-eabi/4.7.3/../../../../arm-none-eabi/lib\libc.a(lib_a-readr.o): In function `_read_r': 

readr.c:(.text._read_r+0x20): undefined reference to `_read' 
collect2.exe: error: ld returned 1 exit status 

的main.c包含以下内容:

#include <stdio.h> 
#include <stdlib.h> 

int main(int argc, char *argv[]) { 
    puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ 
    return EXIT_SUCCESS; 
} 

gcc -v回报版本信息,以便路径是正确的

+0

那么,你有图书馆的问题。看来你正在使用'newlib'编译器。你正在为** Linux **,** Android **,** iPhone **或**裸机**或**独立式**环境编程?您的主机是** Window 7 **或者这是** Windows Phone **?对于'newlib',主板必须实现一些最基本的功能。你已经实现了这些,或者是被编译为* BeagleBoard *,* Raspberry Pi *等的编译器。你从哪里得到编译器?请回答这些问题中的一部分以帮助下一个看到你的问题的人。 – 2013-04-09 03:49:03

回答

0

你开发ARM7或ARM9或ARM9上运行Linux? 对于其中的每一个,您都需要不同的工具链。

好像你正在为ARM7开发(看编译器的可执行文件名),如果没有,那么你可能会使用错误的编译器。

这个问题似乎是你没有正确设置编译器工具链,它需要适当的路径设置正确的安装。

我有设定杆YAGARTO(针对ARM-GCC特定的分布)某些指令的位置: (http://www.electronicsfaq.com/2012/11/blinky-and-printf-on-netduino-using.html

我用netduino板,其上有一个ARM7。