well c++ compiler is annoying as heck and can't be trusted
you have imported it though ?
|
For a university project we are creating game scenes using the Irrlicht game engine in c++.. I'm finding it really difficult learning the basics of the language as its so different to everything else i've learnt..
Here is an error I've been trying to fix for about 2 hours now.. can anyone please help
http://gyazo.com/7da909fcc1c9b5d2fbbeb7934b7b84b7
http://gyazo.com/466d8e3cd2b53a6aad4370c66c1fa135
http://gyazo.com/9532056bb50036d39a053d790152792c
If anyone could explain why i'm getting this error it would help so much.
Thanks for your time
Edit: trying to get images embedded.
well c++ compiler is annoying as heck and can't be trusted
you have imported it though ?
Erm.. I've had problems with importing in the past with this same error..
at the moment all of the include statements are in the stdafx.h file and then that is included into these classes.
It does really seem like bullshit to me.. the object is defined so why is it saying its not..
I'm still trying to fix this.. this is the new error i'm getting
again makes no sense.. missing ";" apparently
have you included the KeyEventReceiver in Client.h?
is what i meant ot ask
either way show your includes for client.h
Okay.. so I've since turned off precompiled headers..
My KeyEventReciever.h now has:
#include <irrlicht.h>
#include "Client.h"
and my Client.h has:
#include <irrlicht.h>
#include "KeyEventReceiver.h"
heres my error message:
you'll run into a circular dependence issues when you have classes including eachother
try importing the class using
above the class decleration instead of the includeCode:class KeyEventReceiver;
or just the client include from keyeventdeceiver, not needed?
I'm currently having this error now..
Anyone have advice =( ?
You need to forward declare in both classes that are co-dependent. If that doesn't work, you should move the co-dependent class inclusion into the definitions file (.cpp). So you'll have something like this:
Happy coding!Code://A.h class B; class A { B* b; public: void setB(B* b); }; //B.h class A; class B { A* a; public: void setA(A* a); }; //A.cpp #include "A.h" #include "B.h" void A::setB(B* b) { this->b = b; } //B.cpp #include "B.h" #include "A.h" void B::setA(A* a) { this->a = a; }
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |