Class inheritance problem

Hi there!
Well first of all I?d like to thank everyone from the list, it?s been very
helpful to read tips and ask stuff here.
Second, I?m having a problem with the 2D graphics engine I?m developing. I?m
doing the event management system right now and decided that I should create
a class named EventHandler that has a pure virtual function named
HandleEvent. This function is the one that, obviously, handles inputs and
any other ocurrencies differently depending on the element of the game we
are talking about, like a sprite, a tile, or, talking high-level, items,
characters and so on.
Many classes must inherit from EventHandler so they are obliged to implement
HandleEvent() and can be all referenced on a single vector that I will use
later to check some things out.
BUT the problem is: I have every class on a header file, and its function
codes on a correspondent .cpp file. So each of these header files supposedly
must include my ‘eventHandler.h’, causing multiple referencing. And I can?t
just use forward referencing to EventHandler, because of the inheritance.
What do I do? I?m using Dev-C++, and all my header files have those #ifndef
#define #endif directives.

Thanks in advance,
O Windows Live Spaces ? seu espa?o na internet com fotos (500 por m?s), blog
e agora com rede social

Hi Carolina,

Your problem is clearly not related with SDL. You should ask in a C++
specific mailing list. I’ve had good experiences with this forum :

Good luck,


Gabriel Gambetta
Mystery Studio -
Gabriel on Graphics -