Problems with compiling classes on gcc 3.2.20020903

Eilmsteiner Reinhard r.eilmsteiner@paysafecard.com
Wed Feb 5 12:17:00 GMT 2003


 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi! 

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. 

This is what i get now: 
make -k 
g++ -ggdb -I../../include -c cexception.cc 
In file included from cexception.cc:17: 
cexception.h:31: parse error before `{' token 
cexception.h:36: destructors must be member functions 
cexception.h:36: virtual outside class declaration 
cexception.h:37: virtual outside class declaration 
cexception.h:38: virtual outside class declaration 
cexception.h:38: non-member function `int GetErrorMessageBufferSize()'
cannot 
   have `const' method qualifier 
.... 

from the headerfile cexception.h: 
//File: cexception.h 

////////////////////////////////////////////////////////////////////////////
//// 
// 
// Generic exception class 
// 
// $Id$ 
// 
////////////////////////////////////////////////////////////////////////////
//// 

#ifndef _CEXCEPTION_H_ 
#define _CEXCEPTION_H_ 

////////////////////////////////////////////////////////////////////////////
//// 

//Global inclusions 
#include <exception> 
#include <stdarg.h> 

//Local inclusions 
#include "cstring.h" 

////////////////////////////////////////////////////////////////////////////
//// 

typedef const char *TErrMsgList []; 
typedef const char **PErrMsgList; 

////////////////////////////////////////////////////////////////////////////
//// 

class CException: public exception 
{ // !! *** Line 31 *** !! 
public: 
  virtual const char *what () const; 
protected: 
  CException (int iErr, PErrMsgList pErrMsgList); 
  virtual ~CException (); 
  virtual void SetErrorMessage (va_list args); 
  virtual int GetErrorMessageBufferSize () const; 
  CString m_sErrMsg; 
  int m_iErrNr; 
  PErrMsgList m_pErrMsg; 
}; 

////////////////////////////////////////////////////////////////////////////
//// 

#endif 

What is going wrong??? 

Please advise, 
Reinhard. 

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPkEAx1aO5+5ahqodEQK2mACg9fafTs7dJmFzIv4jmNgeFOOiP1kAn3lF
k8+Ze7I3qHeRvGofxNvwQ2CW
=LdZK
-----END PGP SIGNATURE-----



More information about the Gcc-help mailing list