I am receiving the following errors from VS22:
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(12657,14): error C2467: illegal declaration of anonymous 'union'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(12874,10): error C2467: illegal declaration of anonymous 'struct'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(12875,6): error C2467: illegal declaration of anonymous 'union'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(18837,6): error C2467: illegal declaration of anonymous 'struct'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winnt.h(21055,24): error C2133: 'Policies': unknown size
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winuser.h(5313,64): warning C4019: empty statement at global scope
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winuser.h(5336,56): warning C4019: empty statement at global scope
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\wtypesbase.h(386,25): warning C4309: 'initializing': truncation of constant value
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winioctl.h(4337,10): error C2467: illegal declaration of anonymous 'struct'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\um\winioctl.h(4338,6): error C2467: illegal declaration of anonymous 'union'
I am using a third party C file in my program as well. It includes windows.h, but not winnt.h as far as I can tell.
Any idea on how to fix this?