CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: syntax error and fatal error

  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Angry syntax error and fatal error

    I try to compile my program and i got these error message from one of my .h file.

    Code

    #pragma once
    /*************************************************************************
    * DEFINITIONS OF NEW TYPES
    *************************************************************************/
    #if !defined(__midl)
    #define __$compname_props \
    __type_has_adt_prop(compname,nullterminated) \
    __type_has_adt_prop(compname,valid_schars) \
    __type_has_adt_prop(compname,correct_len) \
    __nullterminated
    #if defined(UNICODE) || defined(_UNICODE)
    #define __$TCHAR unsigned short
    #else
    #define __$TCHAR char
    #endif

    typedef __$compname_props char* ValidCompNameA;
    typedef __$compname_props unsigned short* ValidCompNameW;
    typedef __$compname_props const unsigned short* ConstValidCompNameW;
    typedef __$compname_props __$TCHAR* SAL_ValidCompNameT;
    typedef __$compname_props const __$TCHAR* SAL_ConstValidCompNameT;
    #undef __$compname_props
    #undef __$TCHAR
    #endif

    /*************************************************************************
    * DEFINITIONS OF INLINE FUNCTIONS FOR CASTING TO THE NEW TYPES : USER
    *************************************************************************/
    #if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_)
    #ifdef __cplusplus
    extern "C" {
    #endif
    void __inline __nothrow __SAL_ValidCompNameA(__out_has_type_adt_props(ValidCompNameA) const void *expr) { expr;}
    void __inline __nothrow __SAL_ValidCompNameW(__out_has_type_adt_props(ValidCompNameW) const void *expr) { expr;}
    #ifdef __cplusplus
    }
    #endif
    #define __assume_ValidCompNameA(expr) __SAL_ValidCompNameA(expr)
    #define __assume_ValidCompNameW(expr) __SAL_ValidCompNameW(expr)
    #else
    #define __assume_ValidCompNameA(expr)
    #define __assume_ValidCompNameW(expr)
    #endif

    Error message
    c:\program files\microsoft sdks\windows\v6.0a\include\specstrings_adt.h(17) : error C2144: syntax error : missing ';' before type 'char'
    c:\program files\microsoft sdks\windows\v6.0a\include\specstrings_adt.h(17) : fatal error C1004: unexpected end of file found

    How to solve this problem???

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: syntax error and fatal error

    This error message is often related to the previous included header or the piece of code that occurs right before you include your header.

    - petter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)