[Solved] winnt.h a large number of file errors (287): error c2059: syntax error: “;”

After including winnt.h, the compiler reports a lot of syntax errors, Error C2146, C4430, C2059, C2062, etc., which occur with various versions of visual studio, including vc6, 2010, 2017, 2019. But the compilation result has no other error location except winnt.h.

If you can’t try many methods, you can try the following:

Note the order of header files:

When importing files, it needs to be consistent with the running logic of the main program as follows:

Read More: