Hello everybody,
i tried to compile an example program for my lpc2378 stk board and in the beginning it worked.
Then I wanted to use floating operations and now i’m getting following errors :
F:\games(E)_zaPodrejdane\ARM_Proba\opit1/main.c:200: undefined reference to `__aeabi_i2d’
F:\games(E)_zaPodrejdane\ARM_Proba\opit1/main.c:200: undefined reference to `__aeabi_ddiv’
F:\games(E)_zaPodrejdane\ARM_Proba\opit1/main.c:200: undefined reference to `__aeabi_d2f’
F:\games(E)_zaPodrejdane\ARM_Proba\opit1/main.c:201: undefined reference to `__aeabi_fmul’
and the code in my main.c:
voltageValueF = voltageValue / 3.3;
voltageValueF *= 1024;
I think this is a linking error.I’m not sure that i have included the library correct or the correct library in my makefile.
Please anyone who knows just take a look at my makefile and tell me what’s wrong there. I’m trying to fix this the whole day… :shock:
My makefile is as follows:
NAME = lpc_p2378
CC = arm-none-eabi-gcc
LD = arm-none-eabi-ld -v
AR = arm-none-eabi-ar
AS = arm-none-eabi-as
CP = arm-none-eabi-objcopy
OD = arm-none-eabi-objdump
CFLAGS = -mcpu=arm7tdmi -I./ -c -fno-common -O0 -g -I"G:\yagarto\arm-none-eabi\include"
AFLAGS = -ahls -mapcs-32 -o crt.o
LFLAGS = -Map main.map -T2378_demo.cmd
LINK_LIBS = -Lg:/yagarto/arm-none-eabi/lib -lc -lm -lg
CPFLAGS = -O binary
HEXFLAGS = -O ihex
ODFLAGS = -x --syms
all: test
clean:
-rm crt.lst crt.o clock.o uart.o main.o main.out main.map main.dmp main.bin
test: main.out
@ echo "...copying"
$(CP) $(CPFLAGS) main.out main.bin
$(OD) $(ODFLAGS) main.out > main.dmp
@echo "...building hex"
$(CP) $(HEXFLAGS) main.out main.hex
main.out: crt.o adc.o clock.o uart.o main.o 2378_demo.cmd
@ echo "..linking"
$(LD) $(LFLAGS) -o main.out crt.o main.o clock.o uart.o adc.o $(LINK_LIBS)
crt.o: crt.s
@ echo ".assembling"
$(AS) $(AFLAGS) crt.s > crt.lst
uart.o: uart.c
@ echo ".compiling uart"
$(CC) $(CFLAGS) uart.c
clock.o: clock.c
@ echo ".compiling clock"
$(CC) $(CFLAGS) clock.c
adc.o: adc.c
@ echo ".compiling adc"
$(CC) $(CFLAGS) adc.c
main.o: main.c
@ echo ".compiling"
$(CC) $(CFLAGS) main.c
I tried to use the option ‘-Wl’ as well but the linker didn’t recognize it.
Thank you in advance for your help!