
19 Oct
2008
19 Oct
'08
4:55 a.m.
Edward Peschko wrote:
H.J -
hmm.
That worked (thanks) but exactly why did it work? Shouldn't gcc be smart enough to realize that it is working either with a c++ file or linking to a c++ library?
It was working like this since forever. When you use g++, then various C++ standard libraries are linked in. Otherwise, they are not. I presume the auto-detection is not done because linking is done by a separate tool, that knows nothing about c++ runtime, and gcc itself cannot detect if c++ runtime should be linked in, because it cannot look inside each library that is used, directly or indirectly. - Volodya