IEventReceiver Problem

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
pszlachetka
Posts: 23
Joined: Mon Aug 30, 2004 12:30 am

IEventReceiver Problem

Post by pszlachetka »

1 C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp In file included from main.cpp
19 C:\Documents and Settings\Owner\Desktop\HangMan\CIrrEngineCore.h cannot declare parameter `eventRec' to be of type ` CMyEventReceiver'
19 C:\Documents and Settings\Owner\Desktop\HangMan\CIrrEngineCore.h because the following virtual functions are abstract:
172 C:\irrlicht-0.6\include\IEventReceiver.h virtual bool irr::IEventReceiver::OnEvent(irr::SEvent)
C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp In function `int main()':
10 C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp cannot declare variable `eventReceiver' to be of type ` CMyEventReceiver'
10 C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp since type `CMyEventReceiver' has abstract virtual functions
11 C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp cannot allocate an object of type `CMyEventReceiver'
11 C:\Documents and Settings\Owner\Desktop\HangMan\main.cpp since type `CMyEventReceiver' has abstract virtual functions

Those are my only compilation errors. I checked back with the tutorial, and I'm not doing much more different than what it does with the event receiver. I just simply have it in a class, and the IrrlichtDevice* pointer and other things are in another class. I'm passing the event receiver to that class, which uses it in createDevice(); But I'm not sure what the deal is with the error.

I've posted all relevant header and source files. The files are not very large, and shouldn't take but a minute to look over.

http://pszlachetka.tripod.com/OtherStuff/main.txt

http://pszlachetka.tripod.com/OtherStuf ... Core_h.txt
http://pszlachetka.tripod.com/OtherStuf ... re_cpp.txt

http://pszlachetka.tripod.com/OtherStuf ... iver_h.txt
http://pszlachetka.tripod.com/OtherStuf ... er_cpp.txt
zola
Posts: 52
Joined: Thu Jul 15, 2004 2:31 pm
Location: switzerland
Contact:

Post by zola »

Hi

check Your definition of the event receiver with this one:
http://irrlicht.sourceforge.net/docu/cl ... eiver.html

And if You don't see the error then check consult some docu about inheritance C++ polymorphism
http://www.google.com/search?hl=en&ie=U ... hism&meta=

edit:
this url look good http://cplus.about.com/od/inheritance/ I haven't read the tutorials though :)
Post Reply