alessandro said:
that's the definition of Tuner and it's base class:
class Tuner:Module
Is this legal? I thought you had to specifiy the inheritance model also
(e.g., ": public Module)?
Also, is there a forward declaration of Module, or is this order you've
shown just for the purposes of posting here? As shown here, Tuner doesn't
yet know what Module is!
{
protected:
SDL_Surface* display; //Main lcd-like display
public:
static const unsigned int type = MODULE_NONE; //Holds a code that
specifies the module
Tuner(Sound* s, Graphic* g, Global* gl);
~Tuner();
virtual void Begin();
/*The following methods are called whenever an input event must be
notified
to the module instance.*/
virtual void MouseUp(Point* p);
virtual void MouseMove(Point* p)
{
mousepos.x = p->x;
mousepos.y = p->y;
}
};
class Module
{
protected:
bool running; //This thread is running
bool pause; //This thread is in pause
Sound* sound; //Global sound data
Graphic* graphic; //Global graphic data
Global* global; //Global variables
Point mousepos; //Position of the mouse
SDL_Surface* icon;
public:
static const unsigned int type = MODULE_NONE; //Holds a code that
specifies the module
Module(Sound* s, Graphic* g, Global* gl, char* iconname);
//~Module()
virtual void Begin();
SDL_Surface* GetIcon() { return icon; }
/*The following methods are called whenever an input event must be
notified
to the module instance.*/
virtual void MouseUp(Point* p) {};
virtual void MouseMove(Point* p)
{
mousepos.x = p->x;
mousepos.y = p->y;
}
};
Most likely you haven't defined a function that is declared somewhere. How
about the destructor for Tuner...is it defined anywhere? I see you've
commented out the destructor declaration for Module. Did you mean to also
comment out Tuner's destructor declaration?
(By the way, if you're ever going to use a Module* pointer to instantiate a
Tuner object, then you should make the Module destructor virtual.)
-Howard