I was having a weird problem with compiling files for a few days.
I couldn’t remember when it started but the compiler kept saying it could not find “ERROR” identifier. “ERROR” is supposed to be in wingdi.h like this.
#define ERROR 0
So I checked my wingdi.h file and it was like it.
#define LOG 0
It didn’t take too much time to realize that wingdi.h was modified recently and all the other header files in the same folder had not been changed at all ever since the visual studio was installed.
I thought it was because I installed some other SDK or programs and I tried to figure out what made this situation. I had never imagined that I changed it. But, yes, I DID IT. OOPS!
I did “replace all” ERROR with LOG for my own project and wingdi.h was open at that moment. Visual Studio modified it and did not say anything when I saved and compiled it. There was no single error because I did not use ERROR in that project.
First of all, wingdi.h is NOT read-only! so if you accidentally modify and save it, you won’t see any warning dialogs. Second, Visual Studio applies “replace all” for all opened files. It doesn’t matter if a file is in your solution or not, even though you choose “Entire solution”. Like the below picture.
So be careful otherwise you could waste hours even days like someone. =+=