virtual inheritance: optimization for empty objects

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Wed Mar 31 23:46:00 GMT 1999


> foo.C:36: `cout' undeclared in namespace `std'
> foo.C:46: `endl' undeclared in namespace `std'
> 
> I used std::cout and std::endl. I works without -fnew-abi.
> 
> I guess I need to rebuild the libstdc++, or what exactly should I
> rebuild?... 

You need much more than that ... you need to rewrite libstdc++. With
-fnew-abi, std is a namespace. So if cout is not in namespace std
(which it isn't in libstdc++ v2), it is an error to refer to it via
std::cout.

You can try arrange libstdc++ to use it consistently, either by
putting the library in std::, or by removing the extra qualifiers.  As
an alternative, you could try libstdc++ v3, which gets this right.

Regards,
Martin



More information about the Gcc mailing list