#Weird errors

6 messages · Page 1 of 1 (latest)

near prism
#

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?

cosmic nightBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

near prism
#

I don't have any code in my main file except for a main function returning 0 and some includes for third party headers.

tardy hound