arm-none-eabi-ld:找不到-lc [英] arm-none-eabi-ld: cannot find -lc

查看:1345
本文介绍了arm-none-eabi-ld:找不到-lc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm trying to code for XMC1100 based development board. I'm trying this tutorial : http://eleceng.dit.ie/frank/arm/BareMetalXMC2Go/index.html

我已经下载了blinky.tar.gz文件并解压缩。当我尝试make我得到这个错误:arm-none-eabi-ld:找不到-lc

I have downloaded the blinky.tar.gz file and unzipped. When I try "make" I'm getting this error : arm-none-eabi-ld: cannot find -lc

这里是make的输出



Here is the output of "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

I'm using Linux Mint 17 Qiana

我缺少什么?

这是我的makefile:

Here is my 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 帮助我。

I met the same problem and sudo apt-get install libnewlib-arm-none-eabi helped me.

这篇关于arm-none-eabi-ld:找不到-lc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆