【发布时间】:2013-04-09 02:43:47
【问题描述】:
这是我输入的命令及其输出的内容:不幸的是,谷歌并没有提供太多帮助,但我尝试了几件事(根据我非常初学者的知识),但我无法解决它。
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 返回版本信息所以路径是正确的
【问题讨论】:
-
嗯,你有图书馆问题。看来您正在使用
newlib编译器。你正在为 Linux、Android、iPhone、bare metal 或 free-站立 环境?您的主机是 Window 7 还是 Windows Phone?对于newlib,必须为开发板实现一些最小功能。你是否实现了这些,或者编译器是否被标记为用于 BeagleBoard、Raspberry Pi 等。你从哪里获得编译器?请回答其中一些问题,以帮助下一个人查看您的问题。
标签: gcc arm cross-compiling gnu