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

Author: Kamil Bahadir (kamil51)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Hello all,

I am using Yagarto tool chain. If I use printf in my code I am getting 
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




Author: Martin Thomas (Guest)
Posted on:

Rate this post
0 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.


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.