# Problems with deriving a class

## Recommended Posts

I would ask this on the Irrlicht forum, but then I'd be waiting 2 days for an answer, and the answer would be "search the forum noob". Besides, I highly doubt my problem is with the engine itself(http://irrlicht.sourceforge.net/). I've gotten the engine up and running, and am able to render scenes. So, I know my environment is properly set up. However, when I get to input handling, there's a problem. Here is my EventHandler.h:
#ifndef LX_EVENTRECEIVER_H
#include <irrlicht.h>

{
public:
virtual bool OnEvent(SEvent event)
{
if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT &&
!event.KeyInput.PressedDown)
{return true;}
}
};
#endif


If I make a source file like this:
#include "EventReceiver.h"
LoriumEventReceiver* pEventReceiver;
I get: C:\projects\lorium\main.cpp In file included from main.cpp C:\projects\lorium\EventReceiver.h expected ;' before '(' token C:\projects\lorium\EventReceiver.h expected ;' before '(' token I feel like 'virtual' shouldn't be there because irr::IEventReceiver declares this as virtual, and I'm supposed to define it. However, Every tutorial and example on irrlicht's site does it this way.

##### Share on other sites
What's the line numbers for those errors?
What's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?

##### Share on other sites
Quote:
 Original post by TelastynWhat's the definition of SEvent? Is that perhaps supposed to be irr::SEvent?

What he said.

##### Share on other sites
Thanks guys, you were right :) SEvent is in the irr namespace. I'm noticing a lot of problems with irrlicht tutorials, most of which are small typos - but they are everywhere!

Their documentation needs some serious help. Thanks again :)

##### Share on other sites
The documentation admittedly could use some work, but I wouldn't be too harsh; it's developed by one person, whose native language isn't even English.

##### Share on other sites
Quote:
 Original post by TDragonThe documentation admittedly could use some work, but I wouldn't be too harsh; it's developed by one person, whose native language isn't even English.

Well I'm really impressed by the engine. As much as I love OOP, I just can't get used to OGRE3D. Irrlicht seems to work more like DirectX, which is what I find comfortable :)

If the author's native language isn't English, then I'm impressed with the documentation. Actually, now that I think about it, my only confusion has come from documentation on the wiki by others.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628336
• Total Posts
2982158

• 9
• 24
• 9
• 9
• 13