我正在使用 Microsoft Visual C++ Express 2012。我在标题设置中包含以下内容:
#include <windows.h>
#include <Ole2.h>
当我windows.h
自己包含时,没有构建错误,但是当我包含Ole2.h
或windows.h
不包含时,windows.h
我得到以下编译器错误:
Error 1 error C2628: '_RPC_ASYNC_NOTIFICATION_INFO::$UnnamedClass$0x1c06c483$29$' followed by 'int' is illegal (did you forget a ';'?) C:\Program Files (x86)\Windows Kits\8.0\Include\shared\rpcasync.h 127 1 Test`
有什么想法可能会出错吗?最终,我正在尝试编写一些简单的代码来与 Kinect 交互,但即使没有任何 Kinect 包含,仍然会生成上述错误。
当我双击我被带到的错误rpcasync.h
和以下代码时:
#if !defined(RPC_NO_WINDOWS_H)
//
// Notification by window message
//
struct {
HWND hWnd;
UINT Msg;
} HWND; //<<<-------- the error points here (HWND is underlined in red)
#endif // RPC_NO_WINDOWS_H
PS 我之所以包括在内Ole2.h
,是因为我正在关注本教程。