We’ve made a plugin that allows reading and writing to a shared memory. It works in 4.19 and it relies on including windows.h to enable functions like OpenFileMapping etc.
However, when including windows.h in 4.20 plugin I am getting:
_WIN32_WINNT_WIN10_TH2 is not defined as a preprocessor macro errors.
Has anyone found a way to mitigate this issue?
I tested this on a blank C++ project where I added a Blueprint function library plugin. The error appears the moment you insert #include <Windows.h> line.
HEY BRADR!! i figured it out. If you take a look at VCToolChain.cs you will find CompileEnvironment.bEnableUndefinedIdentifierWarnings !
Which means if you go to your ProjectFolder\ProjectName.Build.cs and use bEnableUndefinedIdentifierWarnings = false as compile option (above PublicDependencyModuleNames) it will compile!
additionally if you visit Engine\Source\Programs\UnrealBuildTool\Configuration\ModuleRules.cs you can find bEnableUndefinedIdentifierWarnings and set to false there for all engine projects to have it disabled also!