Error C2143 and C2059

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Prashanth Kumar B R
    New Member
    • Jun 2007
    • 5

    Error C2143 and C2059

    Hello,

    I have the below typedef statements in one of my header file.

    //
    // Type Definitions
    //
    typedef unsigned long DWORD;
    typedef unsigned int UINT;
    typedef unsigned short WORD;
    typedef unsigned char BYTE;
    typedef unsigned char UNCHAR;
    typedef int BOOL;
    typedef unsigned int UINT32;
    typedef unsigned char UINT8;
    typedef unsigned short UINT16;

    I get an error
    error C2143: syntax error : missing ';' before 'constant'
    error C2059: syntax error : 'constant'
    both point to the line "typedef unsigned short WORD;"
    Also note the errore are listed twice.

    Can somebody help me with this.

    Thanks
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Are you sure WORD isn't already #define'd by some other header file?

    kind regards,

    Jos

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      All of these are defined by Microsoft already. Just include windows.h.

      Comment

      Working...