Thread: Error in sourceannotations.h

  1. #1
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341

    Error in sourceannotations.h

    I'm using Visual C++ 2008 Express, and I'm getting an error message with one of Visual C++'s header files:
    Code:
    1>------ Rebuild All started: Project: project4, Configuration: Debug Win32 ------
    1>Deleting intermediate and output files for project 'project4', configuration 'Debug|Win32'
    1>Compiling...
    1>main.cpp
    1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(19) : error C2144: syntax error : '__w64 unsigned int' should be preceded by ';'
    1>polynomial.cpp
    1>c:\program files (x86)\microsoft visual studio 9.0\vc\include\codeanalysis\sourceannotations.h(19) : error C2144: syntax error : '__w64 unsigned int' should be preceded by ';'
    1>Generating Code...
    1>Build log was saved at "file://c:\Users\Brad\Documents\Visual Studio 2008\Projects\project4\project4\Debug\BuildLog.htm"
    1>project4 - 2 error(s), 0 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    I'm kinda clueless as to what piece of my code would cause this error. (I assume it's my code and not Microsoft's). Here's the segment of code that the error points to:
    Code:
    ...
    #ifndef _SIZE_T_DEFINED
    #ifdef  _WIN64
    typedef unsigned __int64    size_t;
    #else
    typedef _W64 unsigned int   size_t;
    #endif
    #define _SIZE_T_DEFINED
    #endif
    ...
    I'll attach my code.
    Don't quote me on that... ...seriously

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    It is exactly as the compiler says: You are missing a semicolon. It happens to be at the end of "polynomial.h", which makes it hard to spot.

    It is also convention to put the "own" header files AFTER the system ones [as a general rule, there are exceptions]. This would have caused the error to be on the first line in YOUR code, rather than in some obscure header file of MS's.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Captain - Lover of the C
    Join Date
    May 2005
    Posts
    341
    OMG, I'm smart. Good catch. And I know that my header files should come after system header files for a number of good reasons but my C instructor thinks this way is best.
    Don't quote me on that... ...seriously

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Perhaps you should look for a different instructor ;-) [Yes, I know, it's not that easy]

    There is one reason to put "your" header files first: It shows that they are "independent", e.g. a header using FILE will include it's own <stdio.h>, instead of relying on one included in the main .c file - but that's the only thing I can think of.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed