printf problem in yagarto tool

OP #1198156
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
Attached files:
Guest
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.

Reply

A question of your own? This thread is over 17 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.