VS2015 Toolchain blocked by errors C3646

For a while now work is being done to enable full support for VS2015. Recently in master branch the project generator was switched to use VS2015 by default (1388452b5b8960618300999f522ea3acc1b405e1).

While the projects where generated, I could not build them because of the following errors VS2015 throws at me:

1>------ Build started: Project: UnrealHeaderTool, Configuration: Development_Program x64 ------
1>  Performing full C++ include scan (building a new target)
1>  Distributing 7 actions to XGE
1>  Performing 7 actions (4 in parallel)
1>  Module.Core.7_of_7.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um\wincodec.h(1010): error C3646: 'PixelFormat': unknown override specifier
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um\wincodec.h(1010): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>  -------- End Detailed Actions Stats -----------------------------------------------------------
1>ERROR : UBT error : Failed to produce item: C:\GitHub\UnrealEngine\master\Engine\Binaries\Win64\UnrealHeaderTool-Core.pdb
1>  Total build time: 2,37 seconds
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(37,5): error MSB3073: The command "..\..\Build\BatchFiles\Build.bat UnrealHeaderTool Win64 Development -waitmutex" exited with code -1.
========== Build: 0 succeeded, 1 failed, 3 up-to-date, 0 skipped ==========

I am on Windows 10 and am running Win10 SDK.

So far I can still workaround the build blocker by using 2013 toolchain in VS2015.

edit: looks like VS doesn’t like win10 sdk…I switched win10 sdk off in UBT - et voila! it builds once again.

Feel free to contact me if you need further info! :slight_smile:

Ruben

Hello rubenst,

It looks like you’ve solved your issue. I’ll be marking this issue as resolved due to that. If I’m incorrect, please comment and the question will reopen and I’ll be happy to assist you with this problem.

Hi ,

what I found is just a workaround. The issue itself is still open and related to trying to compile a VS2015 based project in combination with Win10SDK.

For some reason VS2015 doesn’t find a couple of definitions used in Win10SDK, e.g.:
C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\um\wincodec.h(1010)

Best regards,

Ruben

I see, thank you for letting me know. Does this issue only occur for projects related to UE4 or does it happen with base C++ projects built with VS2015 when using the Win10SDK? I’m interested to know if it’s an issue with Visual Studio itself or not.

I have not tested other plain c++ projects as my c++ “skills” are condtrained to what I like to call “U#” only :slight_smile: …plain c++ gives me headaches :smiley:

But the error seems to be an issue with VS/Win10SDK itself. Some searches on the web that I did mentioned that these definitions were removed from the sdk and put in other places, though they weren’t clear on where to get them and how to fix it exactly. Might wann hit this up with the engineers from Microsoft.

Best regards,

Ruben

Hello rubenst,

It seems that this issue is related to Windows 10, Visual Studio 2015, and the Windows10SDK. It would be best to contact Microsoft customer support about this issue. Unfortunately as this issue doesn’t seem to be inherent to UE4, I am unable to help with this problem.

It appears to be a problem with the compiler getting confused between the dcommon.h in %ENGINE_DIR%/Engine/Source/ThirdParty/Windows/DirectX/Include and the one in the Windows 10 SDK include directory. After removing the dcommon.h in the engine source directory, it builds fine. So I think there’s something wrong with what directories are being included when you specify a Windows 10 SDK build in the Unreal Build Tool.

Just to follow up on what Mustard867 wrote, this showed up for us due to WindowsPlatformSplash.cpp including “wincodec.h”.

wincodec.h includes dcommon.h, and the ThirdParty/Windows/DirectX/Include/dcommon.h is found before the one in the Win10 SDK folder and is missing things the SDK wincodec.h needs. This is just due to the order the PublicIncludePaths have things added to them.

Removing or renaming the dcommon as suggested works, apparently nothing else uses it. A perhaps slightly better option is to fix the reason DirectX is in the include path: Xinput’s paths being included in Core.Build.cs. Changing this:

		if ((Target.Platform == UnrealTargetPlatform.Win64) ||
			(Target.Platform == UnrealTargetPlatform.Win32))
		{
			PublicIncludePaths.Add("Runtime/Core/Public/Windows");
			AddEngineThirdPartyPrivateStaticDependencies(Target, 
				"zlib");

			AddEngineThirdPartyPrivateStaticDependencies(Target, 
				"IntelTBB",
				"XInput"
				);
		}

To this:

	if ((Target.Platform == UnrealTargetPlatform.Win64) ||
		(Target.Platform == UnrealTargetPlatform.Win32))
	{
		PublicIncludePaths.Add("Runtime/Core/Public/Windows");
		AddEngineThirdPartyPrivateStaticDependencies(Target, 
			"zlib",
			"IntelTBB");

		if(!WindowsPlatform.bUseWindowsSDK10)
		{
			AddEngineThirdPartyPrivateStaticDependencies(Target,
			    "xinput"
			);
		}
		else
		{
			PublicAdditionalLibraries.Add("XInput.lib"); //Included in Win10 SDK
		}
	}

There may be a few more problems lurking with the DirectX paths and Windows 10… but they’re hiding for now… :slight_smile:

Could this issue be addressed please? I just wasted a bunch of time on this. On a standard VS2017 install Unreal fails to build out of the box with the Windows 10 SDK. As previously suggested it is a problem with the build configuration.