C++ – vs 2008 623 compiler errors

cvisual studio

I have a c++ console app that has been doing just fine and upon clean make started throwing compiler errors. Obviously I've redefined or omitted something, but I'm not sure what.

------ Rebuild All started: Project: alpineProbe, Configuration: Release Win32 ------
Deleting intermediate and output files for project 'abc', configuration 'Release|Win32'
Compiling...
wmiTest.cpp
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h(60) : error C2065: '_$notnull' : undeclared identifier
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h(60) : error C3861: '_Pre1_impl_': identifier not found
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h(60) : error C2146: syntax error : missing ')' before identifier '_Deref_pre2_impl_'
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h(60) : warning C4229: anachronism used : modifiers on data are ignored
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h(64) : error C2059: syntax error : ')'
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h(94) : error C2144: syntax error : 'int' should be preceded by ';'
C:\Program Files\Microsoft Visual Studio 9.0\VC\include\ctype.h(94) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

I'm sure it's something obvious, but I don't see it. One other thing, I reloaded the project from a backup copy.

Edit:

Using /showIncludes as suggested by Michael Burr gives the following:

1>Note: including file: c:\development\alpineaccess\final\Tokenizer.h
1>Note: including file:  c:\development\alpineaccess\final\testFunctions.h
1>Note: including file:   c:\development\alpineaccess\final\curl/curl.h
1>Note: including file:    c:\development\alpineaccess\final\curl\curlver.h
1>Note: including file:    C:\Program Files\Microsoft Visual Studio 9.0\VC\include\stdio.h
1>Note: including file:     C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h
1>Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\include\sal.h
1>Note: including file:       c:\program files\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h
1>Note: including file:        C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\windows.h
1>Note: including file:         C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\sdkddkver.h
1>Note: including file:         C:\Program Files\Microsoft Visual Studio 9.0\VC\include\excpt.h
1>Note: including file:          C:\Program Files\Microsoft Visual Studio 9.0\VC\include\crtdefs.h

Note that there's a circular reference via sourceannotations.h. I see what the problem is, but have no idea how to fix it.

Best Answer

JaredPar's answer has something to do with it, but you shouldn't have to include sal.h yourself - something's causing the wrong sal.h to be picked up (or another wrong header). <sal.h> should be included by <crtdefs.h> which is included by the standard headers, but clearly the right one isn't being picked up for some reason.

Try using the "/showIncludes" option ("Configuration Properties/C/C++/Advanced/Show Includes" in the IDE's project options) to see what headers are being included from where.

Related Topic