Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / wtf wierd

Author
Message
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 9th Aug 2009 16:10
I get lots of indentifier undefined errors even though I'm including them right...

code:
gfunc.h:

image.h:


error:


I wanna know why it's giving me these errors

and help would be apprecieted

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 9th Aug 2009 16:40
Image.h is including gfunc.h before it has defined the Image class - gfunc.h doesn't know what an 'Image' is for your function definitions.

Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 9th Aug 2009 16:42 Edited at: 9th Aug 2009 16:48
Quote: "
Image.h is including gfunc.h before it has defined the Image class - gfunc.h doesn't know what an 'Image' is for your function definitions.
"


if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 10th Aug 2009 00:03
I don't understand... can you give a more detailed response?

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
tomtetlaw
15
Years of Service
User Offline
Joined: 18th Jan 2009
Location:
Posted: 10th Aug 2009 00:29
Ok, sorry, I fixed that by having a shared.h file for getNextID() but now I get this error, even though I've removed the definition and the declaration from gfunc.h and gfunc.cpp, it gives me this error:


This is my gfunc.h:

gfunc.cpp:


Any help will and has been appreciated

#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif
Amnzero
15
Years of Service
User Offline
Joined: 1st Aug 2009
Location:
Posted: 10th Aug 2009 00:38
Where did you move your getNextID definition?

if(enemy == Amnzero) runAway();
Amnzero->WebSite = L"http://neovance.com/";
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Aug 2009 00:47 Edited at: 10th Aug 2009 00:47
Quote: "I fixed that by having a shared.h file for getNextID()"

Why? That was the one function in that header that was ok.

Anyway, you can't just dump a function definition into a header file - it will create a separate copy of that function in every .cpp file that directly or indirectly includes it, and causing your 'already defined' linker errors.

Either put the definition into its own .cpp file and change the header to just hold the declaration, or make the function definition 'inline'.

I'm kinda getting the impression that you are making changes without actually understanding what the real problems with your errors are and what's causing them. Maybe you should brush up on the basics a little?

Login to post a reply

Server time is: 2024-11-20 17:35:01
Your offset time is: 2024-11-20 17:35:01