Results 1 to 7 of 7
Hey guys I wrote a program however there is a compilation error that I just don't understand....
- 10-10-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 13
Compilation error
Hey guys I wrote a program however there is a compilation error that I just don't understand.
- 10-10-2007 #2
There are only two files involved, right? battle.c and battle.h?
Ok, then. Make copies of them, battle1.c and battle1.h. Make sure you change battle1.c so it #includes battle1.h, not battle.h.
Then start throwing things out of battle1.c and battle1.h. Make them as tiny as you can and still reproduce the error. Squeeze every unnecessary line out of them.
On the way, I'm sure you'll find the error.
If you don't, then take the resultant tiny files (fewer than 25 lines each, I'm sure) and post them here in their entirety so we can compile them too and play with them.
- 10-10-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 13
well there is three files
- 10-10-2007 #4
Really, the best way to solve this is to follow the advice I gave in post #2. In the long run, you'll get better debugging skills that way.
But I'll give it a shot with what you posted.
There is no obvious wrongness in the code you posted. But here's a question: In which file is SIZE #defined?
- 10-10-2007 #5Just Joined!
- Join Date
- Sep 2007
- Posts
- 13
its defined in the main file, isn't that correct? It seems that all of them are placed in there right?
- 10-11-2007 #6I can't really tell unless you follow the advice in post #2. But if you say that's where it's #defined, here's the next step.its defined in the main file, isn't that correct?
If SIZE is #defined in work.c, how does the compiler know what SIZE is when it's compiling battle.c? I'm thinking that there's your problem.
Again, just guessing, because ... well, you know.
- 10-11-2007 #7Just Joined!
- Join Date
- Sep 2007
- Posts
- 13
Hey thanks I found out the error with the code. Thanks alot again!


Reply With Quote