This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with virtual functions

Here is the class definition:

#ifdef __GNUG__
#pragma interface

class StateFile;
class Interface;
class ostream;

class GTracker {
  virtual ~GTracker() ;

  virtual void set_state(StateFile& statefile, Interface *interface) ;
  virtual void write_state(ostream& s) ;

  virtual void set_defaults() ;

  virtual void reset() ;

  virtual void step_once(int field, int nfields) ;

  virtual void display() ;

I use this class as pure virtual.
Still, I have defined function bodies for each function in a seperate cc-file.
The constructor and destructor bodies are both empty,  the other functions cout the string "not implemented".

Alexandre Oliva wrote:

On May 17, 2001, wrote:

> Wouldn't the compiler refer explicitely to the undefined method, if something
> like that happens?

It would refer to it in the virtual table, but the virtual table
didn't get defined because of that.

Care to post the definition of class GTracker?

Alexandre Oliva   Enjoy Guarana', see
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

Volker Krüger              |\ |\ |\   Center For Automation Research, Rm# 4465
University of Maryland     | \| \| \   phone: +1 (301) 405-1756  fax: 314-9115
A. V. Williams Building    |  |  |  \   url:
College Park, MD 20742     |__|__|___\   email:      
******************         PGP key available          ************************
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]