Problem compiling stdafx.cpp on all c++ projects

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi everyone.

Im using MS Visual Studio 2008 on Vista 32-bit Home Premium with SP1.

For the past year I have been using VS2008 for c++ projects using MFC and had no issues.
About two days ago i did: Build > Clean Solution and everything went down hill from there!

The solution was cleaned successfully, at least thats what VS2008 told me. Then I tried to compile my project and this is what i got:

1>Compiling...
1>stdafx.cpp
1>f:microsoft visual studio 9.0vcincludenew.h(60) : error C2065: _In_opt_ : undeclared identifier
1>f:microsoft visual studio 9.0vcincludenew.h(60) : error C2146: syntax error : missing ) before identifier new_handler
1>f:microsoft visual studio 9.0vcincludenew.h(60) : warning C4229: anachronism used : modifiers on data are ignored

..... more errors

1>f:microsoft visual studio 9.0vcincludeexcpt.h(64) : error C2059: syntax error : )
1>f:winddkincapiwindef.h(49) : error C2143: syntax error : missing ; before *
1>f:winddkincapiwindef.h(51) : error C2143: syntax error : missing ; before *


.... theres alot more but i wont put it all here!

1>f:microsoft visual studio 9.0vcincludectype.h(105) : fatal error C1003: error count exceeds 100; stopping compilation



so i messed around with project settings for the rest of the day to try to figure out what went wrong, couldnt get the thing to compile.

i decided to start a new project and copy and paste my code into that, maybe my project files were corrupted some how. The new MFC dialog based project, before i changed anything, also didnt compile. I got the same errors as before. So i realised it wasnt a problem with my code.

later i unistalled VS2008 and re-installed according to: http://msdn.microsoft.com/en-us/vstudio/bb968856.aspx

i started a new project, tried to compile, but still the same errors with stdafx!!

i havent made any significant changes to my computer recently, no MS updates or anything that might explain this.

Also knowing that stdafx is involved with precompiled headers i disabled this option in project settings, but that still doesnt solve the problem.

I dont understand why VS2008 stopped working all of a sudden.

Any help with this would be greatly appreciated.

If i cant solve this problem then the next step is to format the comp, pain in the butt and a massive waste of time.




View the full article
 
Back
Top