ue4 调用windows库函数报错 error C2872: error C2872: “DWORD”: 不明确的符号

来源:互联网 发布:手机怎么查mac地址 编辑:程序博客网 时间:2024/05/16 02:52

当在虚幻引擎(ue4)中调用 windows api 是 会出现一下类似的错误时:

1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(114): error C2872: “DWORD”: 不明确的符号
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1>  c:\epic games\ue_4.14\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或  “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\shared\rpcasync.h(126): error C2872: “UINT”: 不明确的符号
1>  C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(177): note: 可能是“unsigned int UINT”
1>  c:\epic games\ue_4.14\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(31): note: 或  “DoNotUseOldUE4Type::UINT”

可以用下面的方法解决:

#include "AllowWindowsPlatformTypes.h"
#include <windows.h>
#include <comdef.h>
#include <WbemIdl.h>
#include "HideWindowsPlatformTypes.h"

阅读全文
0 0