Thursday, June 21, 2007

Monstrous compilation error on any MFC application

Ok, I've just created a simple MFC DLL, hit the compile button and I got this monstrous error:

c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\excpt.h(36): error C2144: syntax error : 'int' should be preceded by ';'
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\excpt.h(36): error C2501: 'x' : missing storage-class or type specifiers

And i was like, "WTF !?".
When I see these kind of errors i instantly get several thoughts but in a 'chain of responsability' pattern way:
'i need to check the code again'
'ummm, lemme search google for the error'
'shit, i need to reinstall the vstudio'
'ok, i think i need 'a' beer'

Ive been lucky enough not to reach the last option in my programming problems ive had so far(though, i dont need programming problems to do that, really).

googling a bit i found somebody adviced for a VisualStudio reinstallation. hmmm. too lazy for doing that (and not necessary). but searchin in the microsoft.com for 'C2144' i got a post with a similar issue and an idea that some of the headears might got mistakenly changed by an accidentaly edit.
i said, Ok, no problem i will do a search on windows explorer to see what was changed today.
i did, and to my horrification i found no change.
luckily, i have another pc with a visual studio installation. i quickly opened windiff over the atlmfc folder. and there it was: 'afxv_w32.h'. a smiley 'x' was lying there.

i wasnt able to find the header simply because it was not changed today. it was changed 2 days ago :|