Irrlicht 1.4 beta : cannot instantiate abstract class

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
eviral
Posts: 91
Joined: Mon Oct 25, 2004 10:25 am

Irrlicht 1.4 beta : cannot instantiate abstract class

Post 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
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You change the parameter to 'const SEvent&', then the signatures match and the compiler will be happy.
enigmaseti
Posts: 7
Joined: Wed Sep 19, 2007 3:58 pm

Post by enigmaseti »

same problem, but where do you change it at?
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Post 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)
{
}
lawck
Posts: 10
Joined: Sun Oct 21, 2007 3:49 am

Post 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.
CuteAlien
Admin
Posts: 9733
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

It's "Frustum" not "Frustrum".
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
lawck
Posts: 10
Joined: Sun Oct 21, 2007 3:49 am

Post by lawck »

Right.
I feel stupid now for missing that. ><

Thanks!
CuteAlien
Admin
Posts: 9733
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Hehe - I only did see it that fast because you're not the first one who made that typo ;-)
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply