IeventReciever error????[solved]
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
IeventReciever error????[solved]
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;
}
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.
Code: Select all
virtual bool OnEvent(SEvent event)
Code: Select all
virtual bool OnEvent(const SEvent &event)
Use the debugger, young Skywalker...
maybe you also should learn to read error messages ???
this line tells you what you should do:
this line tells you what you should do:
and if you do so and have look at the declaration of "OnEvent" you'll see what's wrong (like ultran00b already told you) !!!d:\program files\microsoft visual studio\vc98\include\ieventreceiver.h(256) : see declaration of 'OnEvent'
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
well bro...
the reason why i couldn't decipher that is that i am a beginner , hence posting in the Beginners forum!!!
acki is an smartypants!!!
acki is an smartypants!!!
Last edited by newbie8787 on Mon Jan 14, 2008 4:49 am, edited 1 time in total.
well, than you definitely need to learn how to read error messages...
ok, the next time you get a compile error you know what to look at first...
ok, the next time you get a compile error you know what to look at first...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
hey acki
Acki, do me a favour ,next time if you have some great advice.....
Keep it to yourself
Keep it to yourself
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
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.
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Yeah, this gonna be a very nice thread, again !!!
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...
and a little bit of selfinitiative would be also good for you !!!
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...
and a little bit of selfinitiative would be also good for you !!!
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Peace
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
Hoping that we'll be able to keep the peace
newbie
Re: Peace
Agreed, so why continue on?newbie8787 wrote:I really don't wanna shouting match here , this is a programming forum and i suggest we stick to it ...
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.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
Last edited by zeno60 on Mon Jan 14, 2008 9:52 pm, edited 2 times in total.
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...
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...
fortunately you have no chance to bann someone, so you'll have to live with comments you don't want to read...
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:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Well....
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!
-
- Posts: 105
- Joined: Thu Jan 10, 2008 6:26 pm
Oh and yeah
Thanks to ultranoob:D and you too.... Acki coz weather i like it or not your post did help me solve my problem!!
Re: Well....
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.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!
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!
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Re: Well....
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.zeno60 wrote:And if you do not want to be judged, don't make your forum handle "newbie."
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
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way