EmbDev.net

Forum: ARM programming with GCC/GNU tools printf problem in yagarto tool


von Kamil B. (kamil51)


Attached files:

Rate this post
useful
not useful
Hello all,

I am using Yagarto tool chain. If I use printf in my code I am getting 
an
linker error!

>> undefined referenced to 'printf'<<

Link flags that I used as below;


LFLAGS  = -nostartfiles -Map $(TARGET).map,--cref
LFLAGS += -lc -lgcc
LFLAGS += -L "C:\Yagarto\lib\gcc\arm-elf\4.3.2\libgcc.a"
#LFLAGS += -L "C:\yagarto\arm-elf\lib\libc.a"

And Compiler flags;

CFLAGS  += -I. -c -g -mcpu=$(MCU) -fverbose-asm
CFLAGS += -O$(OPT) -std=gnu99
CFLAGS += -Wall -Wcast-align -Wcast-qual -Wimplicit
CFLAGS += -Wpointer-arith -Wswitch
CFLAGS += -Wredundant-decls -Wreturn-type -Wshadow -Wunused

yagarto information;
binutils: 2.18
gcc:      4.3.2
newlib:   1.16.0
gdb:      6.8.50-20080308-cvs

Regards

kamil


kamil

von Martin Thomas (Guest)


Rate this post
useful
not useful
Please re-read the PM I have sent in reply to your e-mail. As already 
requested there: please create a minimal example including all sources, 
linker-script and (complete) makefile which shows the issue. Pack it 
into a ZIP-archive and attach it to a message. It's difficult to help if 
you show just a few lines from a makefile. Before you send the example, 
please review the makefile:
- I suggest to use the frontend (...gcc) to call the assembler
- Try to avoid usage of absolute pathes in the makefile.
- Use the frontend to call the linker, do not call ...-ld directly. With 
this there is no need to set absolute pathes to the used libc.
I will try to reproduce the issue here with a GNU toolchain from a 
non-Yagarto package but maybe other reader of the forum can test with 
tools from Yagarto once you have uploaded your example.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.