Thanks for your reply:
Here is the complete output of the build process:
make -k all
...compiling main.c
arm-elf-gcc -I./ -c -fno-common -O0 -g main.c
...linking
arm-elf-ld -v -lc -Map main.map -Tdemo_at91sam7_blink_flash.cmd -o
main.out crt.o main.o lcd.o lowlevelInit.o debug.o libgcc.a
GNU ld version 2.17
main.o: In function `main':
I:\SOFTWARE\5.Semester\ARM_Projects\demo_at91sam7_blink_flash/main.c:49:
undefined reference to `printf'
make: *** [main.out] Error 1
make: Target `all' not remade because of errors.
This is the Makefile that i'm currently using:
# ***************************************************************
# Makefile for Atmel AT91SAM7S256 - flash execution
#
#
# * James P Lynch September 3, 2006 *
# ***************************************************************
NAME = demo_at91sam7_blink_flash
# variables
CC = arm-elf-gcc
LD = arm-elf-ld -v -lc
AR = arm-elf-ar
AS = arm-elf-as
CP = arm-elf-objcopy
OD = arm-elf-objdump
CFLAGS = -I./ -c -fno-common -O0 -g
AFLAGS = -ahls -mapcs-32 -o crt.o
LFLAGS = -Map main.map -Tdemo_at91sam7_blink_flash.cmd
CPFLAGS = --output-target=binary
ODFLAGS = -x --syms
OBJECTS = crt.o main.o lcd.o lowlevelInit.o debug.o
# make target called by Eclipse (Project -> Clean ...)
clean:
-rm $(OBJECTS) crt.lst main.lst main.out main.bin main.hex main.map
main.dmp
#make target called by Eclipse (Project -> Build Project)
all: main.out
@ echo "...copying"
$(CP) $(CPFLAGS) main.out main.bin
$(OD) $(ODFLAGS) main.out > main.dmp
main.out: $(OBJECTS) demo_at91sam7_blink_flash.cmd
@ echo "...linking"
$(LD) $(LFLAGS) -o main.out $(OBJECTS) libgcc.a
crt.o: crt.s
@ echo "...assembling crt.s"
$(AS) $(AFLAGS) crt.s > crt.lst
main.o: main.c include\AT91SAM7X256.h include\board_ex256.h
include\registers.h include\lcd.h
@ echo "...compiling main.c"
$(CC) $(CFLAGS) main.c
lcd.o: lcd.c include\AT91SAM7X256.h include\ext_registers.h
include\lcd.h include\bits.h
@ echo "...compiling lcd.c"
$(CC) $(CFLAGS) lcd.c
lowlevelInit.o: lowlevelInit.c include\AT91SAM7X256.h
include\board_ex256.h
@ echo "...compiling lowlevelInit.c"
$(CC) $(CFLAGS) lowlevelInit.c
debug.o: debug.c include\AT91SAM7X256.h include\board_ex256.h
include\lib_AT91SAM7XC256.h
@ echo "...compiling debug.c"
$(CC) $(CFLAGS) debug.c
and yes i inculded:
#include <stdio.h>
#include <stdlib.h>
to my main.c file
I got these error message when i'm using functions like printf, malloc,
sprintf...
Is the liggcc file the newlib library. If not please tell me where I can
find it in the yagarto filestructure.
Thank's a lot
Greetings,
T_RAIN
Martin Thomas wrote:
> T_RAIN wrote:
>> Currently i got the folliwing error:
>>
>> Code:
>> undefined reference to `malloc'
>
> Is this the complete message? Did you include <stdio.h>? Any message
> about with "sbrk"? Did you search the forum for newlib, syscalls and
> stdo? Please paste or attach the complete output from the build-process.