vs 2008 crazy errors (desperate!)

Hi folks --

(Please forgive my OT post: I'm trying to compile a C program.)

I (think I) just reinstalled vs2008 c++ express. This was to fix
strange errors the compiler was claiming to find in stdio.h and other
header files. These compile errors began to appear yesterday: I
figured reinstalling would give me a new copy of everything in the /
include directories.

According to help->about, I installed

Microsoft Visual C++ 2008 91909-152-0000052-60357

The installation package, again according to help->about, included
sp1:

Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB945282)
Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB946040)
Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB946308)
Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB947540)
Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB947789)
Hotfix for Microsoft Visual C++ 2008 Express Edition with SP1 - ENU
(KB948127)

The reinstall did not fix anything, except that now the (newly-
installed, I believe) compiler complains

1>e:\program files\microsoft visual studio 9.0\vc\include\codeanalysis
\sourceannotations.h(19) : error C2054: expected '(' to follow 'd'

(the message is for the line:"typedef _W64 unsigned int size_t;")

and follows with more than 100 similar messages.

What have I done wrong? How can I fix it?

Thanks! I'm totally mystified.

-- ben
Is sourceannotations.h a file you wrote? Or is it part of some library or something?

Such an obscure error seems to hint that you have macro troubles. I suspect _W64 might be #defined somewhere as something different, which would utterly destroy that typedef line and give you the bizarre error message.

To test... at the start of this header, try putting this (probably put it after any #include lines):

1
2
3
#ifdef _W64
#error "This will error if _W64 is a macro"
#endif 


If you get that error, that's got to be the problem.

Thanks!

> Is sourceannotations.h a file you wrote? Or is it part of some library or something?

I've never seen this thing before. It's here (vs is on drive e):

E:\Program Files\Microsoft Visual Studio 9.0\VC\include\CodeAnalysis\sourceannotations.h

Should it be "visual studio 9.0?" Or did I download the wrong thing? That would certainly fit right in with the insane numbering schemes for vs :-)

I put this into the sourceannotations.h file:

#ifdef _W64
#error "This will error if _W64 is a macro"
#endif
#ifdef W64
#error "This will error if W64 is a macro"
#endif
#ifdef __w64
#error "This will error if __w64 is a macro"
#endif

and no error happened. _W64 (and the lc switch /Wp64) seems to have something to do with detecting 64-bit portability problems when compiling on a 32-bit platform. I turned off "#include sourceannotations.h" and the errors around that particular header went away.

But the errors that started happening yesterday came back (that is, they now fall within the 100-error quit limit), for example:

1>e: ... \crtdefs.h(498) : error C2146: syntax error : missing ',' before identifier 'rsize_t'
referring to the line "typedef size_t rsize_t;"

1>e: ... \crtdefs.h(507) : error C2085: 'intptr_t' : not in formal parameter list
referring to the line "typedef _W64 int intptr_t;"

Compiler Error C2146 is "syntax error : missing 'token' before identifier 'identifier'"

Compiler Error C2085 is " 'identifier' : not in formal parameter list. The identifier was declared in a function definition but not in the formal parameter list."


The compiler complains only about the header files vadefs.h, crtdefs.h, and stdio.h (yeah, "only").

I'm just completely stumped.

-- pete



Topic archived. No new replies allowed.