Sign in to follow this  
MystikIce

Weird #if/#endif error...

Recommended Posts

MystikIce    122
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.

Share this post


Link to post
Share on other sites
MystikIce    122
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_ */

Share this post


Link to post
Share on other sites
clum    217
You probably accidentally deleted an #if from your own code. Check that it all matches.

Share this post


Link to post
Share on other sites
schue    176
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_ */

Share this post


Link to post
Share on other sites
ApochPiQ    23061
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.

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