Build Error from sourceannotations.h

Jan 3, 2013 at 9:26 PM

Hello, I have been using these tools for some time with great results and no problems.  Today, I made a minor change to function.cpp and got the following errors on Build:

1>------ Build started: Project: Toolkit, Configuration: Debug Win32 ------
1>  function.cpp
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29): error C2144: syntax error : '__w64 unsigned int' should be preceded by ';'
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\codeanalysis\sourceannotations.h(29): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


The following are the lines from sourceannotations.h that I currently have, starting with the beginning of the file.  I added the line numbers for convenience:

1  /***
2  *SourceAnnotations.h - Source Annotation definitions
3  *
4  *       Copyright (c) Microsoft Corporation. All rights reserved.
5  *
6  *Purpose:
7  *       Defines internal structures used by the Source Code analysis engine.
8  *
9  ****/
11  #if _MSC_VER >= 1400
13  #pragma once
15  #ifndef _M_CEE_SAFE  // Source annotation attributes don't work with /clr:safe
17  #if !defined(_W64)
18  #if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
19  #define _W64 __w64
20  #else
21  #define _W64
22  #endif
23  #endif
25  #ifndef _SIZE_T_DEFINED
26  #ifdef  _WIN64
27  typedef unsigned __int64    size_t;
28  #else
29  typedef _W64 unsigned int   size_t;
30  #endif
31  #define _SIZE_T_DEFINED
32  #endif

Any ideas on how to clear this hurdle?  Should I just re download all the files and copy in my current function file to get back to where I was before this error?

Thanks for your help in advance.


Jan 3, 2013 at 11:50 PM

I discovered that I had accidentally entered three letters as the very first characters in function.cpp.  The letters were "fou".  For some reason the compiler got stuck in the sourceannotations.h file instead of giving a compile error in function.cpp.

Just a reminder that very small errors can result in unexpected results.

Have a good day all!


Jan 7, 2013 at 11:34 AM

C++ compiler errors can be pretty cryptic. It is a price you have to pay when you run with the big dogs.