[uClibc]compiling c++ apps?

jeand at telusplanet.net jeand at telusplanet.net
Mon Nov 18 17:44:27 UTC 2002


Hi,

This sounds, to me, like a newbie question, but it's got me stumped, so I 
thought I'd ask it anyways. 8-)

When compiling c++ apps that reference c++ stuff using gcc, the standard 
libraries aren't linked in automatically.  I need to add '-lstdc++ -lm -lgcc_s' 
to the command-line.


conftest.C:
#include <iostream>
int main() {return 0;}

gcc conftest.C
undefined reference to 'std::ios_base::Init::INit[in-charge]()'
etc.

g++ conftest.C
no errors (other than the current bug about dl_iterate_phdr)

In my main distribution, gcc works like g++ when confronted with C++ code.  So 
what is the difference?

Jean Duteau

P.S.
I tried the above in my built system and in Erik's reference system with the 
same results.





More information about the uClibc mailing list