IeventReciever error????[solved]

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.
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

IeventReciever error????[solved]

Post by newbie8787 »

this is a trimmed down version of the movement tut (4)
i am trying to run this ,but it giver the following errors:
--------------------Configuration: test - Win32 Debug--------------------
Compiling...
test.cpp
Compiling Irrlicht with Visual Studio 6.0, support for DX9 is disabled.
c:\foobar\irredit-1.4alpha\test.cpp(41) : error C2259: 'MyEventReceiver' : cannot instantiate abstract class due to following members:
c:\foobar\irredit-1.4alpha\test.cpp(12) : see declaration of 'MyEventReceiver'
c:\foobar\irredit-1.4alpha\test.cpp(41) : warning C4259: 'bool __thiscall irr::IEventReceiver::OnEvent(const struct irr::SEvent &)' : pure virtual function was not defined
d:\program files\microsoft visual studio\vc98\include\ieventreceiver.h(256) : see declaration of 'OnEvent'
c:\foobar\irredit-1.4alpha\test.cpp(41) : error C2259: 'MyEventReceiver' : cannot instantiate abstract class due to following members:
c:\foobar\irredit-1.4alpha\test.cpp(12) : see declaration of 'MyEventReceiver'
c:\foobar\irredit-1.4alpha\test.cpp(41) : warning C4259: 'bool __thiscall irr::IEventReceiver::OnEvent(const struct irr::SEvent &)' : pure virtual function was not defined
d:\program files\microsoft visual studio\vc98\include\ieventreceiver.h(256) : see declaration of 'OnEvent'
c:\foobar\irredit-1.4alpha\test.cpp(53) : error C2039: 'addTestSceneNode' : is not a member of 'ISceneManager'
d:\program files\microsoft visual studio\vc98\include\iscenemanager.h(148) : see declaration of 'ISceneManager'
Error executing cl.exe.

test.exe - 3 error(s), 2 warning(s)



#include <stdio.h>
#include <wchar.h>
#include <irrlicht.h>

using namespace irr;

#pragma comment(lib, "Irrlicht.lib")

scene::ISceneNode* node = 0;
IrrlichtDevice* device = 0;

class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(SEvent event)
{

if (node != 0 && event.EventType == irr::EET_KEY_INPUT_EVENT &&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_W:
case KEY_KEY_S:
{
core::vector3df v = node->getPosition();
v.Y += event.KeyInput.Key == KEY_KEY_W ? 2.0f : -2.0f;
node->setPosition(v);
}
return true;
}
}


return false;
}
};

int main()
{
MyEventReceiver receiver;

device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480),

16, false, false, false, &receiver);

video::IVideoDriver* driver = device->getVideoDriver();

scene::ISceneManager* smgr = device->getSceneManager();

node = smgr->addTestSceneNode();
node->setPosition(core::vector3df(0,0,30));
node->setMaterialTexture(0, driver->getTexture("Projrctmedia/wood74-r.jpg"));

smgr->addCameraSceneNodeFPS(0, 100.0f, 100.0f);
device->getCursorControl()->setVisible(false);



int lastFPS = -1;

while(device->run())

{

driver->beginScene(true, true, video::SColor(255,90,90,156));

smgr->drawAll();

driver->endScene();

int fps = driver->getFPS();

if (lastFPS != fps)

{

wchar_t tmp[1024];

swprintf(tmp, 1024, L"Movement Example - Irrlicht Engine (%s)(fps:%d)",
driver->getName(), fps);

device->setWindowCaption(tmp);

lastFPS = fps;

}

}



device->drop();
return 0;
}
Last edited by newbie8787 on Mon Jan 14, 2008 7:38 am, edited 1 time in total.
ultran00b
Posts: 35
Joined: Tue Oct 30, 2007 3:30 pm

Post by ultran00b »

Code: Select all

virtual bool OnEvent(SEvent event)
should be changed to

Code: Select all

virtual bool OnEvent(const SEvent &event)
I think...
Use the debugger, young Skywalker...
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

maybe you also should learn to read error messages ??? :roll:
this line tells you what you should do:
d:\program files\microsoft visual studio\vc98\include\ieventreceiver.h(256) : see declaration of 'OnEvent'
and if you do so and have look at the declaration of "OnEvent" you'll see what's wrong (like ultran00b already told you) !!!
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

well bro...

Post by newbie8787 »

the reason why i couldn't decipher that is that i am a beginner , hence posting in the Beginners forum!!! :roll:


acki is an smartypants!!!
Last edited by newbie8787 on Mon Jan 14, 2008 4:49 am, edited 1 time in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

well, than you definitely need to learn how to read error messages... :lol:
ok, the next time you get a compile error you know what to look at first... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

hey acki

Post by newbie8787 »

Acki, do me a favour ,next time if you have some great advice.....
Keep it to yourself
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

No, seriously, you need to drop the attitude.

I say "need" advisedly because if you actually intend to be a software developer of any sort, then you will need to be able to read and understand compiler error messages, and then fix your own problems. You cannot come to other people for help over and over and over again and expect to be spoon fed answers, as you've been doing here.

Software development is all about problem solving. If you're really not interested in solving problems, then you won't enjoy developing software.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Yeah, this gonna be a very nice thread, again !!! :twisted:

well, another advice you want not to hear about:
read about the Netiquette: http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=11199

and yes, it's always a good advice to do a search (by Google, in the forums) and it's an even more good advice to learn anything about the IDE and compiler you're using !!! ;)
at least it should be no problem, even for a very noob, to read the error messages and understand what they mean, especially in such a realy simple case like this... :roll:

and a little bit of selfinitiative would be also good for you !!! :lol:
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

Peace

Post by newbie8787 »

I really don't wanna shouting match here , this is a programming forum and i suggest we stick to it ... oh and yes Rogerborg, i have not said a word to you and you for some reason have been taking potshots at me for some time now , i suggest, that if you dont wanna answer my posts ,or you think my questions are stupid, just dont post an answer for me , even if you can coz then me being the lazy bum i am will have to search ... ok

Hoping that we'll be able to keep the peace
newbie
zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Re: Peace

Post by zeno60 »

newbie8787 wrote:I really don't wanna shouting match here , this is a programming forum and i suggest we stick to it ...
Agreed, so why continue on?
newbie8787 wrote: oh and yes Rogerborg, i have not said a word to you and you for some reason have been taking potshots at me for some time now , i suggest, that if you dont wanna answer my posts ,or you think my questions are stupid, just dont post an answer for me , even if you can coz then me being the lazy bum i am will have to search ... ok

Hoping that we'll be able to keep the peace
newbie
How about if you are going to get offended at reasonable replies you not even bother posting in the first place? You should be very grateful that acki & rogerborg even bothered to reply and help as they are 2 of the more experienced and frequent forum users. They could have easily told you to just RTFM (read the f*cking manual) as that the answer someone deserves who can't decipher, debug and search on the forums/google for the answer.
Last edited by zeno60 on Mon Jan 14, 2008 9:52 pm, edited 2 times in total.
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

When you ask a question inside a forum than you ask every member of the forums... ;)
fortunately you have no chance to bann someone, so you'll have to live with comments you don't want to read... :lol:

and if someone acts like you did than it forces some people (incl. me) to reprimand you !!! ;)

and you'll never win such a battle, because most of us don't get rude or harsh, the only one who does is you and so you're on a lost post... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

Well....

Post by newbie8787 »

rogerborg wrote:That's OK, because your time is a lot more valuable than ours.
rogerborg wrote:I absolutely could not care one iota less about your deadlines even if I was wearing my Care Less About Your Deadlines shirt in a Care Less About Your Deadlines parade on national Care Less About Your Deadlines day.
zeno60 wrote: They could have easily told you to just RTFM (read the f*cking manual) as that the answer someone deserves who can't decipher, debug and search on the forums/google for the answer.

Well Acki from what i can see , people do tend to get rude and harsh more than often here, well, i refuse to indulge in this anymore, you guys can keep on flaming newbies for their questions , but there will always be sensible experienced users who will realize that this is a beginners forum and if you are visiting a beginners forum you are bound to run into some questions that may seem trivial to you, but are important for the people who have posted them, well .. if u still wanna continue with this fruitless pursuit you guys can go ahead , i have a code to complete and i will post any questions that i need answered on this forum weather you like them or not and you can either choose to share your knowledge with people or go around judging them!
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

Oh and yeah

Post by newbie8787 »

Thanks to ultranoob:D and you too.... Acki :roll: coz weather i like it or not your post did help me solve my problem!!
zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Re: Well....

Post by zeno60 »

newbie8787 wrote:
rogerborg wrote:That's OK, because your time is a lot more valuable than ours.
rogerborg wrote:I absolutely could not care one iota less about your deadlines even if I was wearing my Care Less About Your Deadlines shirt in a Care Less About Your Deadlines parade on national Care Less About Your Deadlines day.
zeno60 wrote: They could have easily told you to just RTFM (read the f*cking manual) as that the answer someone deserves who can't decipher, debug and search on the forums/google for the answer.

Well Acki from what i can see , people do tend to get rude and harsh more than often here, well, i refuse to indulge in this anymore, you guys can keep on flaming newbies for their questions , but there will always be sensible experienced users who will realize that this is a beginners forum and if you are visiting a beginners forum you are bound to run into some questions that may seem trivial to you, but are important for the people who have posted them, well .. if u still wanna continue with this fruitless pursuit you guys can go ahead , i have a code to complete and i will post any questions that i need answered on this forum weather you like them or not and you can either choose to share your knowledge with people or go around judging them!
Who is flaming who? I (and I believe others) are simply suggesting that you take the initiative and do some learning by finding answers to your own problems. Your right, this is a beginners forum, and yes, there will be trivial questions, but all those questions exactly like yours that were asked before got answered in the exact same way: "Search the forums." Very little of those asking the questions replied to the answers by ignorantly telling them (and rudely I might add) to "KEEP IT TO YOURSELF," most of them did exactly that, search, and what did they find? The answer of course. Next time they had a trivial question what did they do, they searched the web, read the API and Taa-Daa found the answer on their own time in as little as 20 minutes.

So continue asking questions, no one can stop you, just as you can't stop everyone of them being answered with "search the forum/read the api." I would only ask that you read "How to ask questions the smart way." http://catb.org/~esr/faqs/smart-questions.html Not for my sake, but to make yourself look less foolish...

And if you do not want to be judged, don't make your forum handle "newbie."

Have a great day!
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Re: Well....

Post by rogerborg »

zeno60 wrote:And if you do not want to be judged, don't make your forum handle "newbie."
Apparently he's also "brandon1987". I thought I recognised the "ZOMG I gots teh mad dedlinez so no time 2 serch sum1 help me reel quick cuz of al teh mad deadlinaz that i gotta keeps telling u about insted ov serching!!!" idiom.

There's a difference between a beginner who wants to learn how to learn, and someone who just wants answers spoon fed to them indefinitely. I think you can guess which pidgeonhole I place Mr *87 here. And the answer to "feed me answarzzz!!!" remains "I fed the last guy. Search for it."
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply