Problems with compiling classes on gcc 3.2.20020903

Rupert Wood me@rupey.net
Wed Feb 5 13:40:00 GMT 2003


Eilmsteiner Reinhard wrote:

> I'm currently trying to compile a program that worked fine when I
> compiled it on a g++ on SuSE 7.3. Then I switched to  g++ (GCC) 3.2
> 20020903 on RedHat 8.0. 

Not sure why the switch would have done this, but:

> #include <exception> 
:
> class CException: public exception 

exception doesn't exist in the top-level namespace. std::exception
should work.

I think some implementations of the STL (e.g. the Dinkumware STL that
came with MSVC++6; don't know if Dinkum-for-Linux does) define exception
in the top level namespace and then imports it into std with using
::exception. In other words, you can get away with either exception or
std::exception. Skimming the C++ standard quickly, you should probably
only rely on std::exception.

In general, 'Parse Error' really means 'undefined type'.

Hope that helps,
Rup.



More information about the Gcc-help mailing list