Get the default link configuration gcc uses when calling the linker.

Posted by witkamp on Stack Overflow See other posts from Stack Overflow or by witkamp
Published on 2010-06-08T21:03:55Z Indexed on 2010/06/08 21:12 UTC
Read the original article Hit count: 244

Filed under:
|
|
|

I am using the CodeSorcery arm-eabi-gcc tool chain and I have a problem using ld separate from gcc

I can compile my simple program and link it, if I let gcc call the ld.

This works not problem

g++ test.cpp; # Works

This does not work because of missing symbols

g++ -c test.cpp

ld -o test crti.o crtbegin.o test.o crtend.o crtn.o -lgcc -lc -lstdc++; # Fails

Notice I am adding the gcc libraries to the ld command

What am I missing?

Also if there is a better way to make configuring ld to using the default gcc linking?

Thanks

© Stack Overflow or respective owner

Related posts about gcc

Related posts about linker