c - arm-none-eabi-ld : cannot find -lc

标签 c gcc embedded mpu

我正在尝试为基于 XMC1100 的开发板编码。
我正在尝试本教程:http://eleceng.dit.ie/frank/arm/BareMetalXMC2Go/index.html

我已经下载了blinky.tar.gz 文件并解压了。当我尝试“制作”时,我收到此错误:arm-none-eabi-ld:找不到 -lc

这是“make”的输出

arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -g init.c -o init.o
arm-none-eabi-gcc -c -mcpu=cortex-m0 -mthumb -g main.c -o main.o
arm-none-eabi-ld init.o main.o  -L /usr/lib/gcc/arm-none-eabi/4.8.2/armv6-m -T linker_script.ld -lc --cref -Map main.map -nostartfiles -o main.elf
arm-none-eabi-ld: cannot find -lc
make: *** [main.elf] Error 1

我正在使用 Linux Mint 17 Qiana

我缺少什么?

这是我的makefile:
LIBSPEC=-L /usr/lib/gcc/arm-none-eabi/4.8.2/armv6-m

# Specify the compiler to use
CC=arm-none-eabi-gcc
# Specify the assembler to use
AS=arm-none-eabi-as
# Specity the linker to use
LD=arm-none-eabi-ld

CCFLAGS=-mcpu=cortex-m0 -mthumb -g

# List the object files involved in this project
OBJS=   init.o \
        main.o 

# The default 'target' (output) is main.elf and it depends on the object files being there.
# These object files are linked together to create main.elf
main.elf : $(OBJS)
    $(LD) $(OBJS) $(LIBSPEC) -T linker_script.ld -lc --cref -Map main.map -nostartfiles -o main.elf
    arm-none-eabi-objcopy -O binary main.elf main.bin
    objcopy -O ihex main.elf main.hex
    @echo "done"

# The object file main.o depends on main.c.  main.c is compiled to make main.o
main.o: main.c
    $(CC) -c $(CCFLAGS) main.c -o main.o


init.o: init.c
    $(CC) -c $(CCFLAGS) init.c -o init.o

# if someone types in 'make clean' then remove all object files and executables
# associated wit this project
clean: 
    rm $(OBJS) 
    rm main.elf
    rm main.bin 

最佳答案

我遇到了同样的问题和 sudo apt-get install libnewlib-arm-none-eabi帮助过我。

关于c - arm-none-eabi-ld : cannot find -lc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28533413/

相关文章:

c - 用 C 编写一个程序,输出给定数字之间的丰富数字序列的第一项和项数

c++ - 引用 this 指针 : GCC vs clang

c++ - GCC 4.1.1 不使用 tr1::unordered_map 编译一些代码

c - 是否有用于嵌入式 C 项目的小型 XML 解析器?

c - 设置位的宏扩展

c - 为什么 ififd 的 pci linux 实现使用 "platform_driver"而不是 "pci_driver"?

c - 关于bash、进程调度和printf()

c - 如何在带有 Verix OS 的 Verifone 设备上使用 ARM 应用程序上的 read() 函数或类似函数

c - 将生成的程序集重写为 GCC 内联汇编

c - 寻找有效的交换字符指针