Skip to main content
gamedev.net
🔒 Locked

Weird #if/#endif error...

Started by MystikIce Jul 6, 2004 at 12:24 PM 4 replies 2.7k views
Original Post
MystikIce
MystikIce
Perhaps someone can help me with this problem. I was compiling my code, which compiled fine. It had a run time error because of an invalid pointer. When I closed down the project and came back to it later, I got the following error when I tried to compile (without modifying any code whatsoever). fatal error C1070: mismatched #if/#endif pair in file '(include dir here)\winuser.h' line 11832... This line is the last line in the winuser.h header file. I have no idea why this happens but it gives me the same error three times. (I have 3 .cpp files in the project, I am assuming 1 error for every file) If anyone can assist, please do. Thank You.
evolutional
evolutional
Is the last line an #endif, by any chance?
MystikIce
MystikIce
Yes it is, here is the last bulk of code.

#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
#include "winuser.inl"
#endif /* ISOLATION_AWARE_ENABLED */
#endif /* RC */

#ifdef __cplusplus

#endif /* __cplusplus */

#endif /* !_WINUSER_ */
clum
clum
You probably accidentally deleted an #if from your own code. Check that it all matches.
Zorx (a Puzzle Bobble clone)Discontinuity (an animation system for POV-Ray)
schue
schue
well, there are 3 #if and 4 #endif.

now, lets see,we have:

#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */

matching:

#endif /* RC */

than

#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)

matching

#endif /* ISOLATION_AWARE_ENABLED */

than

#ifdef __cplusplus

matching

#endif /* __cplusplus */

which leaves us with:

#endif /* !_WINUSER_ */
ApochPiQ
ApochPiQ
schue, your logic may not always work out properly. For example, if there is an #ifndef _WINUSER_ somewhere earlier in the file, there may not be a mismatch at all in that particular header.

Check the modified date of winuser.h - if it is any time recent, look for a replacement copy. Otherwise clum is probably correct - that there's a missing directive in your own code. Look for any directives before the #include of winuser.h and make sure they don't have mismatches. Sometimes compilers can have a hard time figuring out which file the error is actually in, and give you slightly misguided results - this is especially common with preprocessor directives.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.