Page 1 of 1

Irrlicht 1.4 beta : cannot instantiate abstract class

Posted: Fri Oct 05, 2007 5:48 am
by eviral
Hello,

I try to recompile my project with Irrlicht 1.4 beta but i have new compilation errors i never had with irrlicht 1.3 :

newt6.cpp(11) : error C2259: 'CMainMenu' : cannot instantiate abstract class
due to following members:
'bool irr::IEventReceiver::OnEvent(const irr::SEvent &)' : is abstract
d:\program files\irrlicht-1.4beta\include\IEventReceiver.h(256) : see declaration of 'irr::IEventReceiver::OnEvent'


Something has changed with OnEvent but how to use now ?

Thanks

Eviral

Posted: Fri Oct 05, 2007 6:18 am
by hybrid
You change the parameter to 'const SEvent&', then the signatures match and the compiler will be happy.

Posted: Mon Oct 22, 2007 5:31 pm
by enigmaseti
same problem, but where do you change it at?

Posted: Mon Oct 22, 2007 5:33 pm
by randomMesh
enigmaseti wrote:same problem, but where do you change it at?
In your code. :roll:

As hybrid wrote, the event is now a constant reference.
So you have to write

Code: Select all

bool OnEvent(const irr::SEvent& event)
{
}
instead of

Code: Select all

bool OnEvent(irr::SEvent event)
{
}

Posted: Tue Oct 23, 2007 4:03 pm
by lawck
Well, I've been trying to port iamarcamera to irrlicht 1.4b, and... I fixed everything I could.

This error was left:

Code: Select all

icamerascenenode.h:
virtual const SViewFrustum* getViewFrustum() const = 0;
And here's how I declared it on the camera class:

Code: Select all

virtual const SViewFrustum* getViewFrustrum() const;

Code: Select all

error C2259: 'irr::scene::IamarCamera' : cannot instantiate abstract class
        due to following members:
        'const irr::scene::SViewFrustum *irr::scene::ICameraSceneNode::getViewFrustum(void) const' : is abstract
        d:\irrlicht-1.4beta\include\icamerascenenode.h(112) : see declaration of 'irr::scene::ICameraSceneNode::getViewFrustum'
Thanks in advance.

Posted: Tue Oct 23, 2007 4:42 pm
by CuteAlien
It's "Frustum" not "Frustrum".

Posted: Tue Oct 23, 2007 5:37 pm
by lawck
Right.
I feel stupid now for missing that. ><

Thanks!

Posted: Tue Oct 23, 2007 5:42 pm
by CuteAlien
Hehe - I only did see it that fast because you're not the first one who made that typo ;-)