with Visual Studio 2019(16.2.3, MSVC v14.22) and Windows 10 SDK(10.0.18362.0).
And when Compile UE4Game Win32, compiler raises this error:
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(2482): error C2338: Windows headers require the default packing option. Changing this can lead to memory corruption. This diagnostic can be disabled by building with WINDOWS_IGNORE_PACKING_MISMATCH defined.
Can I surpress this error or should I modify source code(or is there any ideas to fix this)?
I found that vctoolchain of UBT forces /Zp8 on 64bit, /Zp4 on 32bit. But there’s no information about unreal should use specific memory packing. I just surressed that diagnostic error.
So, the problem is that the new Windows 10 SDK version (10.0.18362.0) has new restrictions that cause the build to fail.
I was able to successfully build it using the 10.0.16299.0 SDK. Therefore, I would recommend you to switch an earlier SDK until the issue is resolved.
You would need to change WindowsSdkVersion in Engine/Source/Programs/UnrealBuildTool/Platforms/Windows/UEBuildWindows.cs to make sure the Automation Tool uses the correct Windows SDK version.
This changes the WindowsSdk for all user projects.
However, doing this for the project only by adding the file under my_project/config/UnrealBuildTool/BuildConfiguration.xml did not work.