Guys, when I link with g++ instead of gcc printf does not work. I'm quessing I need to supply the gcc standard library but I have no joy finding any specifics.
linking with g++ instead of gcc
Author
Message
Level: Moderator
Joined: Mon. Jul 18, 2005
Posts: 101172 View posts
Location: (using avr-gcc in) Finchingfield, Essex, England
By default there is a link with "-lc" (so libc.a) whereas for C++ it needs to be the C++ standard lib. I forget what it's called (which is why StackOverflow was invented) but you need -lstdc++ or whatever it is to force it into the link. Actually probably -Wl,-l....etc
BTW you are only about the 10 gazillionth person reinventing this wheel so any question you could possibly ask about this HAS already been asked on StackOverflow.