Updated to 4.20 now i can't build, error C4668

1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8910): error C4668: ‘_WIN32_WINNT_WIN10_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8916): error C4668: ‘_WIN32_WINNT_WIN10_RS1’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8921): error C4668: ‘_WIN32_WINNT_WIN10_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8925): error C4668: ‘_WIN32_WINNT_WIN10_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8932): error C4668: ‘_WIN32_WINNT_WIN10_RS2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8942): error C4668: ‘_WIN32_WINNT_WIN10_RS2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8946): error C4668: ‘_WIN32_WINNT_WIN10_TH2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8951): error C4668: ‘_WIN32_WINNT_WIN10_RS3’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8958): error C4668: ‘_WIN32_WINNT_WIN10_RS4’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8961): error C4668: ‘_WIN32_WINNT_WIN10_RS1’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8964): error C4668: ‘_WIN32_WINNT_WIN10_RS4’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(8969): error C4668: ‘_WIN32_WINNT_WIN10_RS1’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif
1>C:\Program Files (x86)\Windows Kits\10\include\10.0.17134.0\um\winioctl.h(9159): error C4668: ‘_WIN32_WINNT_WIN10_RS2’ is not defined as a preprocessor macro, replacing with ‘0’ for ‘#if/#elif

After updated to 4.20, the warring change to error, and I can’t find out how to fix this

Have the same issue

same here, using mongoc.h

Same here, Please help me. Unable to fix this issue.

I have written #include "Windows.h" in my code.Then cause the same issue.My solution:


Add #define WIN32_LEAN_AND_MEAN before #include "Windows.h"

Same here, bumping :stuck_out_tongue:

Add #define WIN32_LEAN_AND_MEAN before
include “Windows.h”

This should be added to each .h file or just to specific ones?

Specific one.

Setting bEnableUndefinedIdentifierWarnings = false; in the Build.cs file helped me compile, however then I got runtime errors.

Anyone have find a solution for this issue?
I have this error stopping me compile my plugin code in my project.

For me it also helped to add the definitions in the constructor in my Plugin.Build.cs like this:

PublicDefinitions.Add("MAKRO_NAME")

An example for where to put it can be found here: Unreal Engine: Including a Third-Party Library (on the example of the Point Cloud Library and Boost) [Tutorial] [Download] – Valentin Kraft's Portfolio

I think this might be a little bit cleaner then opening every file and then adding the #def tag there?

2 Likes

Add below before include “windows.h”
#include “Windows/WindowsWindow.h”

Worked for me! Thank You!

This worked for me, much appreciated! :slight_smile:

WHERE?? DO WE PUT THAT???