【问题标题】:ARM GCC Compiling errors (Windows 7)ARM GCC 编译错误 (Windows 7)
【发布时间】: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


【解决方案1】:

您是在为运行 linux 的 ARM7 或 ARM9 或 ARM9 开发吗? 您需要为其中的每一个使用不同的工具链。

似乎您正在为 ARM7 开发(查看编译器可执行文件名称),如果不是,那么您可能使用了错误的编译器。

问题似乎是您没有正确设置编译器工具链,它需要正确安装并设置正确的路径。

我有一些关于设置 arm YAGARTO(arm-gcc 的特定发行版)的说明: (http://www.electronicsfaq.com/2012/11/blinky-and-printf-on-netduino-using.html)

我使用的是netduino 板,上面有一个 ARM7。

【讨论】:

    猜你喜欢
    • 2019-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-09-17
    • 1970-01-01
    相关资源
    最近更新 更多