Csnnot Instaniate Abstract Class - State Machine

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
teckygamer
Posts: 9
Joined: Wed Jul 28, 2010 8:12 pm

Csnnot Instaniate Abstract Class - State Machine

Post by teckygamer »

Hi, im currently try vitek's statemachine so that i can play if it and understand it, however i have come across a error,

main.cpp(85) : error C2259: 'CGame' : cannot instantiate abstract class
1> due to following members:
1> 'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
1> c:\users\bakara\desktop\myirrlichtapp\include\ieventreceiver.h(441) : see declaration of 'irr::IEventReceiver::OnEvent'

This refers to

Code: Select all

class CGame	: public IEventReceiver	, public CStateGraphT<CGame, SEvent>
{
public:
......
....
...
....
....
	//! adapt from irrlicht event handling to ours
	  virtual bool OnEvent(SEvent event)
	{
		return onEvent(event);
	}
Im relatively new to irrlicht, any help would be much appreciated. This is my understanding, The OnEvent function in the my CGame class is overriding the OnEvent function in IEventReceiver. However the compiler see it as abstract.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Csnnot Instaniate Abstract Class - State Machine

Post by Acki »

teckygamer wrote:1> due to following members:
1> 'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
this message tells you exactly what's wrong !!! :lol:
look what it tells about the function and see what your's looks like !!! ;)
also check the api for the declaration...
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
teckygamer
Posts: 9
Joined: Wed Jul 28, 2010 8:12 pm

Post by teckygamer »

Ty i have been looking at it for so long that i missed that fact it suppose to be a constant
Post Reply