After retargeting my solution to SDK version 10.0 (latest installed version) (10.0.18362) and upgrading my projects to platform toolset v142, I am receving compile-time errors in winnt.h as follows:
...\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: '}'
This happens purely as a result of the upgrade. What might I have done wrong?
It turns out I had defined a
CR
macro in my code like so:It was overwriting the name of a struct data member in the Windows SDK header.
The same thing happened to this fellow asking for help on the MSFT dev boards.
You'll have to rename your
#define
or avoid upgrading the SDK.