Q: -fhonor-std / how to include "gas"

Joe Buck jbuck@Synopsys.COM
Wed Mar 31 23:46:00 GMT 1999


>  1. How do I enable support for namespace std in C++? I know about the
>     compile time switch -fhonor-std, but apparently this option
>     doesn't do anything under NetBSD/i386 Unix.

Yes, it does.

>      | #include <iostream>
>      | #include <string>

What you're missing is that libstdc++ hasn't been converted to use the
std namespace, the names are in the global namespace.

>     I already suspected that I need to compile the libstd++ library
>     with the -fhonor-std option first of all, in order to place the
>     external components into the correct namespace, but all attempts
>     of doing so failed.

-fhonor-std won't affect the current libstdc++ (the one distributed with
egcs).  The new library (libstdc++ v3) does put the classes in the std
namespace, so there it has an effect.




More information about the Gcc mailing list