gpt4 book ai didi

重定向到最新 SDK (10.0.18362) 后 WINNT.H 中的编译器错误

转载 作者:太空宇宙 更新时间:2023-11-04 03:08:45 28 4
gpt4 key购买 nike

将我的解决方案重新定位到 SDK 版本 10.0(最新安装的版本)(10.0.18362) 并将我的项目升级到平台工具集 v142 后,我在 winnt.h 中收到编译时错误,如下所示:

...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18611,19): error C2143: syntax error: missing ':' before 'constant'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18611,22): error C2143: syntax error: missing ';' before ':'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18611,22): error C2059: syntax error: ':'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18612,29): error C2143: syntax error: missing '{' before ':'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18612,29): error C2059: syntax error: ':'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18613,9): error C2059: syntax error: '}'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18614,5): error C2059: syntax error: '}'
...\Windows Kits\10\Include\10.0.18362.0\um\winnt.h(18615,1): error C2059: syntax error: '}'

这纯粹是升级的结果。我可能做错了什么?

最佳答案

事实证明,我在我的代码中定义了一个 CR 宏,如下所示:

#define CR "\r"

它正在覆盖 Windows SDK header 中结构数据成员的名称。

typedef struct _IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY {
DWORD BeginAddress;
union {
DWORD UnwindData;
struct {
DWORD Flag : 2;
DWORD FunctionLength : 11;
DWORD RegF : 3;
DWORD RegI : 4;
DWORD H : 1;
DWORD CR : 2; // <-- conflicting member
DWORD FrameSize : 9;
} DUMMYSTRUCTNAME;
} DUMMYUNIONNAME;
} IMAGE_ARM64_RUNTIME_FUNCTION_ENTRY, * PIMAGE_ARM64_RUNTIME_FUNCTION_ENTRY;

同样的事情发生在this fellow asking for help on the MSFT dev boards .

您必须重命名您的 #define 或避免升级 SDK。

关于重定向到最新 SDK (10.0.18362) 后 WINNT.H 中的编译器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58751720/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com