c:\program files (x86)\windows kits\8.1\include\shared错误

C++编译 Win8.1 Kit shared Error@C++常见错误

c:\program files (x86)\windows kits\8.1\include\shared错误

两次Visual Studio编译C++程序都报这个错误,网上搜了半天也没搜到,最后DEBUG到代码中出错的定位在ktmtypes.h中,改变了 类 _KCRM_MARSHAL_HEADER中Unused的名字,将Unused改为新名字(例如UnusedUnused),再重新保存即可
更改前:

typedef struct _KCRM_MARSHAL_HEADER {
    ULONG              VersionMajor;
    ULONG              VersionMinor;
    ULONG              NumProtocols;
    ULONG              Unused;        // for alignment purposes
} KCRM_MARSHAL_HEADER, *PKCRM_MARSHAL_HEADER, *RESTRICTED_POINTER PRKCRM_MARSHAL_HEADER;

更改后:

typedef struct _KCRM_MARSHAL_HEADER {
    ULONG              VersionMajor;
    ULONG              VersionMinor;
    ULONG              NumProtocols;
    ULONG              UnusedUnused;        // for alignment purposes
} KCRM_MARSHAL_HEADER, *PKCRM_MARSHAL_HEADER, *RESTRICTED_POINTER PRKCRM_MARSHAL_HEADER;

你可能感兴趣的:(C++常见BUG)