Compiling from source with Windows SDK 10 fails

I recently installed Windows SDK 10 on my Windows 10 machine (used to only have SDK 8.1). The engine wouldn’t compile, and it gave me a million redefinition errors, all originating in WindowsSDK/10/…/corecrt.h. After regenerating project files with no success, I searched for a solution online, and I found this line in UEBuildWindows.cs:

public static readonly bool bUseWindowsSDK10 = false;

which I changed to true. It would then give me another error in WindowsPlatformAtomics.h which said that InterlockedCompareExchange128 was undefined. So I switched back to SDK 8.1, and now the engine seems to be compiling fine. The first issue seems to have been resolved automatically, but I still can’t compile against SDK 10. Is there anything I can try?

Which version of the Windows 10 SDK do you have installed? Version 10.1.10586.212 works for me. More recent versions caused problems similar to what you mentioned.

The most recent version from maybe a week ago, which is probably more recent than yours. So, this looks like a bug to me.

Hi ,

I just tried building a newly downloaded 4.16.3 on a Windows 10 machine using Visual Studio 2017 with the Windows 10 SDK installed, and it built successfully without giving me any errors or warnings. Do you have any more information about your setup that may help to reproduce the issue that you were experiencing?

Sure, I’ll get back to you when I get to work tomorrow.

So, here’s my setup:

OS: Windows 10 version 1607
Visual Studio 2017 Version 15.2 (26430.6)
Engine Version 4.16.2, pulled from GitHub release branch
Windows SDK version 10.0.15063 (I think, I got this number out of the registry, not sure if it's the right one)

And the error is:

engine\source\runtime\core\public\Windows/WindowsPlatformAtomics.h(171): error C2039: 'InterlockedCompareExchange128': is not a member of '`global namespace''
engine\source\runtime\core\public\Windows/WindowsPlatformAtomics.h(171): error C2660: 'FWindowsPlatformAtomics::InterlockedCompareExchange128': function does not take 4 arguments

Hi ,

I made another attempt to reproduce this and was successful this time. I am not sure why it did not work for me previously. I have entered UE-48414 to have this investigated further.