C++ vs2015 导入sapi.h 时和原有代码出现冲突 怎么解决?

wzqnn 2016-11-10 09:23:33
C++ vs2015 导入sapi.h 时和原有代码(UE4的还有原有类库的)出现冲突 求大神帮忙解决!


1>------ 已启动生成: 项目: MySpeak, 配置: Development_Editor x64 ------
1> Performing 2 actions (4 in parallel)
1> MyActor.cpp
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(396): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(438): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(457): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(639): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(656): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(657): error C2872: “DWORD”: 不明确的符号
1> C:\Program Files (x86)\Windows Kits\8.1\include\shared\minwindef.h(156): note: 可能是“unsigned long DWORD”
1> c:\program files (x86)\epic games\4.12\engine\source\runtime\core\public\Misc/DisableOldUETypes.h(34): note: 或 “DoNotUseOldUE4Type::DWORD”
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): error C2872: “DWORD”: 不明确的符号
1>C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(663): fatal error C1003: 错误计数超过 100;正在停止编译
1>ERROR : UBT error : Failed to produce item: G:\UE4\MySpeak\Binaries\Win64\UE4Editor-MySpeak.pdb
1> Total build time: 3.48 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: 命令“"C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat" MySpeakEditor Win64 Development "G:\UE4\MySpeak\MySpeak.uproject" -waitmutex”已退出,代码为 5。请验证您是否有足够的权限来运行此命令。
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========



...全文
331 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2016-11-11
  • 打赏
  • 举报
回复
调整“项目、属性、C/C++、附加包含目录”的顺序?
赵4老师 2016-11-11
  • 打赏
  • 举报
回复
调整#include的顺序?
yxwsbobo 2016-11-11
  • 打赏
  • 举报
回复
你这个错误是 DoNotUseOldUE4Type 中的 DWORD 污染了 windowsSDK 找一下 肯定有个地方 引入了 DoNotUseOldUE4Type 的命名空间
wzqnn 2016-11-11
  • 打赏
  • 举报
回复
是在 sapi.h 里明确一下 DWORD吗? 现在 只有sapi.h 可以 改 其他的 都是系统的 改不了
yxwsbobo 2016-11-11
  • 打赏
  • 举报
回复
都是些什么人啊,我啊 提示那么明白, 不明确的符号定义 显然 全局有个 DWORD DoNotUseOldUE4Type 里也有个DWORD 而你还 using namespace DoNotUseOldUE4Type; 解决办法 明确一下就行了 全局的使用 ::DWORD 估计你的是要 DoNotUseOldUE4Type::DWORD
小灸舞 2016-11-10
  • 打赏
  • 举报
回复
在#include"sapi.h"之前的一行加上:
#include<windows.h>
wzqnn 2016-11-10
  • 打赏
  • 举报
回复
是 那些 错的 代码导入Windows.h 还是在sapi.h里导入啊?
ipqtjmqj 2016-11-10
  • 打赏
  • 举报
回复
DWORD没定义,#include <windows.h>就行了吧
ipqtjmqj 2016-11-10
  • 打赏
  • 举报
回复
combaseapi.h这个头文件你在哪个文件中引入,编译可以一个个文件分开编译,这样来排查错误的地方
wzqnn 2016-11-10
  • 打赏
  • 举报
回复
改变 顺序 也不行啊 还是 报那个错 #include<windows.h> #include "sapi.h"
paschen 版主 2016-11-10
  • 打赏
  • 举报
回复
改变下这个头文件与windows.h的包含顺序试下

65,183

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧