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 / class problems

Author
Message
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 8th Jan 2012 20:56 Edited at: 8th Jan 2012 21:11
Can anyone tell me what is wrong with this?(genclass.h)

That is the entire header
Here is steamclass.h:

my main looks like this.



Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Jan 2012 21:01
There is nothing wrong except there is nothing inside them. What problems are you seeing?

The fastest code is the code never written.
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 8th Jan 2012 21:13
well um, I added some details to the first post after I found that putting the same code in steamclass would work.
Here is my problem:



Hawkblood
14
Years of Service
User Offline
Joined: 5th Dec 2009
Location:
Posted: 8th Jan 2012 21:52
You may be #include "genclass.h" more than once.

The fastest code is the code never written.
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 8th Jan 2012 23:11
Hmm, I kind of do.
Then how do I have multiple headers include 1 header?


JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 8th Jan 2012 23:12
Add a #pragma(once); line at the top of each header.

Or:



Either will keep genclass.h from redefining everything it contains with every file that includes it.

Hope that helps,

JTK
DeadTomGC
13
Years of Service
User Offline
Joined: 11th Aug 2010
Location: LU
Posted: 8th Jan 2012 23:41
Thanks JTK! I've never learned about those directives. I guess now would be a good time to start.
well, it works for now. Thanks to both of you!


Login to post a reply

Server time is: 2024-04-25 16:46:12
Your offset time is: 2024-04-25 16:46:12