Sign in to follow this  
wraith811

Issues with header files

Recommended Posts

I've tried to put together this text based game and I'm having trouble trying to get it to work. Every time I try to use a weapon.h the game will not compile; however, when I comment it out the game works fine. I just can't use weapons as objects. Here is the output build at pastebin.com: http://pastebin.com/Dw3kQMwc The complete game is at pastebin.com as well here: http://pastebin.com/UfkKJ8FT Thanks, let me know what you think.

Share this post


Link to post
Share on other sites
Okay, this looks like a problem with how you have included the files, but also some syntax and other things.

You can read this: http://www.gamedev.net/reference/articles/article1798.asp, and also check the lines that the semi-colon error messages refer to.

Share this post


Link to post
Share on other sites
I kind of understand the article but how come depending where I move the weapon.h file inside the library.h file I get different errors. To me that would signal that their is some kind of dependency issues. What I don't get is that it's a header file so it shouldn't be dependent upon any other file except the file that explains its parent class. Still confused and unsure what to do.

Share this post


Link to post
Share on other sites
Well, its official, I'm a moron! For some reason I decided to check the weapon.h file and realized that I was missing a semi-colon at the end of the class definition. Thanks man for pointing me in the right direction. Its amazing what the brain can do and can't do sometimes :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this