我正在尝试使用gcc(来自GNU Tools ARM Embedded)编译一个拇指代码。
键入命令行gcc.exe C:\foo.c -o foo.o -mthumb
我收到以下错误:
c:/ program files(x86)/ gnu tools arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../ .. /arm-none-eabi/lib/thumb\libc.a(lib_a-exit.o):在函数
exit': exit.c:(.text.exit+0x1a): undefined reference to
_ exit'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-sbrkr.o):在函数_sbrk_r': sbrkr.c:(.text._sbrk_r+0xc): undefined reference to
_ sbrk'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-writer.o):在函数_write_r': writer.c:(.text._write_r+0x10): undefined reference to
_ write'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-closer.o):在函数_close_r': closer.c:(.text._close_r+0xc): undefined reference to
_ close'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-lseekr.o):在函数_lseek_r': lseekr.c:(.text._lseek_r+0x10): undefined reference to
_ lseek'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-readr.o):在函数_read_r': readr.c:(.text._read_r+0x10): undefined reference to
_ read'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-fstatr.o):在函数_fstat_r': fstatr.c:(.text._fstat_r+0xe): undefined reference to
_ fstat'中 c:/程序文件(x86)/ gnu工具arm embedded / 5.2 2015q4 / bin /../ lib / gcc / arm-none-eabi / 5.2.1 /../../../../ arm- none-eabi / lib / thumb \ libc.a(lib_a-isattyr.o):在函数_isatty_r': isattyr.c:(.text._isatty_r+0xc): undefined reference to
_ isatty'中 collect2.exe:错误:ld返回1退出状态
如何解决这些错误?