Reputation: 131
when including the windows.h library , i suddenly get this weird error
NOTE: when i didnt use windows.h, the program worked just fine. this is the code:
only the true and false enums are not compiling.. why is that? thank you guys very much.
Upvotes: 1
Views: 1379
Reputation: 76
TRUE and FALSE are usually #defined as -1 and 0 (or perhaps 1 and 0). So when the first pass of the compiler does the substitution, the next pass of the compiler is given:
typedef enum{ -1, 0 }bools;
which is obviously not valid syntax.
Upvotes: 0
Reputation: 133599
Mostly because TRUE
and FALSE
are already defined as macros in "windows.h"
(or included by it).
So somewhere there is, for example,
#define TRUE (1)
That code gets replaced inside your enum
declaration raising a syntax error.
Upvotes: 4