C++ linked statically?

Dimitry Andric dimitry@andric.com
Tue May 26 19:15:00 GMT 2009


On 2009-05-26 20:44, Piotr Borys wrote:
> Here it is, full output:
...
> main.o serial.o -Bstatic -lstdc++ -Bdynamic -lstdc++ -lm -lc -lgcc_s
> -lgcc -lc -lgcc_s -lgcc

There's your problem, the '-lstdc++' option is specified twice, once
just after -Bstatic, then after -Bdynamic, and (as far as I know) the
last option takes precedence.  So libstdc++ is still dynamically linked
in this case.

This is because you are using g++, which automagically adds the
-lstdc++.  So please try using 'gcc' instead of 'g++'.

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list