http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57784
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |WONTFIX --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- This is hard to fix and will not be fixed as gcc does not know it is writing to a source file or a file you just happen to name to end with .cc . -lstdc++ is considered an object file enough to link with which is why you see this behavior with that only.