Build Failed with VS 2015 update 3

It’s because of the following change in VS 2015 RC3:

“When using PCH files, mismatched -I include directories to the compiler between -Yc and -Yu compilations will now produce a new warning. C4599”

This is getting thrown as an error, even though it looks like the build tool isn’t setting /WX. You cannot use the normal suppression of errors via the project or solution file because UE4 isn’t actually built by VS and you can’t use the pragma warning directives in the cpp files to suppress the error either. Attempting to uninstall the RC3 update leaves VS in a state where it continually crashes on startup and I cannot seem to find an installer from MS that doesn’t already have RC3 included so I can do a fresh reinstall.

Unfortunately, at the moment, I don’t have a solution, only the cause. I think I’m going to have to grab source from github and see if I can fix it manually but that’s kinda a PITA when I really just want to fiddle around with my game.

Creating makefile for hot reloading UnrealMatch3Editor (modules to compile have changed)
Compiling game modules for hot reload
Performing 10 actions (4 in parallel)
Grid.cpp
Match3GameInstance.cpp
Match3BlueprintFunctionLibrary.cpp
Match3.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Grid.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3GameInstance.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3BlueprintFunctionLibrary.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
Match3GameMode.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3GameMode.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
Match3PlayerController.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3PlayerController.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
Match3SaveGame.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Match3SaveGame.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
Tile.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Source\Match3\Tile.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
Match3.generated.cpp
C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Intermediate\Build\Win64\UE4Editor\Inc\Match3\Match3.generated.cpp : error C4599: ‘/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE’: command line argument number 279 does not match precompiled header
ERROR : UBT error : Failed to produce item: C:\Users\a\Documents\Unreal Projects\UnrealMatch3\Binaries\Win64\UE4Editor-Match3-8607.dll
Total build time: 19.39 seconds
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ““C:\Program Files (x86)\Epic Games\4.12\Engine\Build\BatchFiles\Build.bat” UnrealMatch3Editor Win64 Development “C:\Users\a\Documents\Unreal Projects\UnrealMatch3\UnrealMatch3.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.

I am having the same issue here.
BTW You can still get VS2015 with update 2, just go to https://www.visualstudio.com/downloads/download-visual-studio-vs

There’s a link on there that claims to be VS2015.2 but it is mislabeled. I downloaded that yesterday as an ISO and it installed RC3.

Success! I had to disconnect from the internet before installing or it would automatically pull down the RC3 update. Let’s hope they fix the C4599 error soon.

Did you uninstall VS completely first ?

I did try to uninstall RC3 and tried to reinstall Update 2 but had issues. I had to use this utility to remove all traces of visual studio so I can do a new clean install of VS2015.2.
Use this as a last resort https://github.com/Microsoft/VisualStudioUninstaller

Just uninstalling RC3 left VS in a very bad state. I had to completely uninstall VS, then install the version with no updates and then install Update 2. Even after that, for some reason VC++ was in a bad state and I had to do a complete repair. After all of that, I am finally back at Update 2 and everything works again.

In VCToolChain.cs, line 250:

// @todo SharedPCH: Disable warning about PCH defines not matching .cpp defines.  We "cheat" these defines a little`
// bit to make shared PCHs work.  But it's totally safe.  Trust us.
Arguments.Append(" /wd4651");

It seems that Visual Studio 2015 is no longer trusting you, Epic. In fact even persevering in the “cheat” by adding

Arguments.Append(" /wd4605");
Arguments.Append(" /wd4651");

does not seem to solve the problem. Please fix.

I thought this may fix. This is what I did and I was able to compile without errors (though custom plug ins are still not working for me for all but development editor builds)

  1. Install VS2015 (with C++, common
    tools, Win 10 SDK)
  2. Installed Win 8.1 SDK from the
    standalone installer (separate from
    VS2015, do NOT add Win 8.1 SDK
    feature from the VS2015 setup). Get it at https://developer.microsoft.com/en-us/windows/downloads/windows-8-1-sdk

No wonders it works like that. The problem arises only when you install Visual Studio 2015 Update 3 RC, which, at the moment of writing, comes in a separate installer. Your procedure will install updates up to Update 2.

Even settings bUseSharedPCHs = false; in BuildConfiguration.cs is not enough. I’m giving up and uninstall/reinstall Visual Studio. My advice is to NOT install Update 3RC (nor Update 3 when it’s released) until we have a proper fix.

no news from unreal ?!

Hi everyone,

I just wanted to pop in here real quick to let you know that we do not yet officially support Update 3 for Visual Studio. Our goal is to have support for new VS updates by the time they are officially released (Release Candidate versions are not official final release versions). Sometimes we are able to get that support into the Engine early, but as of right now it is not in place.

I brought this up with the individual who will be responsible for making sure support for Update 3 is added to the Engine. He has ** not ** done any testing on this yet, but he believes it should be possible to correct this issue by opening the WindowsPlatformCompilerSetup.h file in source code (this won’t correct it for the binary version of the Engine, unfortunately), and remove 4599 from the table of warnings at the top. Then add #pragma warning(disable : 4599) below the list. It is possible that this may not work since the warning is coming from command line arguments instead of source, but it’s the first thing he is going to try when he starts working on support for Update 3. He also said that he does not believe this edit will have any adverse affect on your game code generation, but stressed again that he has not done any testing yet.

For now we recommend sticking with Visual Studio 2015 Update 2.

Tim

I still have the same problem with 4.12.3 and the released version of VS2015 Update 3. Any news on that issue?

Moved from 4.9 to 4.11. Had to install VS15 today and got same error. As one can only download Update 3 on VS website
It’s officially released today according to Visual Studio 2017 15.9 Release Notes | Microsoft Docs

This worked for me with 4.12.3

I had to make sure that my configuration was all x64 which my UE4 was NOT so I added the configuration, x64 platform there… ( Build → Configuration Manager)… added x64 from Win32 Settings

I also searched for the WindowsPlatformCompilerSetup.h using Ctrl+Shift+F type in the name , tell it to search for entire Solution, then go down to line 34 or so and insert #pragma warning(disable : 4599)

Then I recompiled UE4 and then my class and it worked for Service Pack 3 ( It added the C++ class to the Content Browser)

NOTE: Before that, in the main toolbar, I only had Build button, the compile button was not present…

Thank you Tim

Now that Microsoft has officially released VS2015 update 3 (no longer RC 3). I went ahead and installed it and UE 4.12 will not compile at all with it. It was working just fine with update 2!! Once the update had finished installing, I did go back to modify the features and I noticed that update 3 removed some of the C++ features. After reinstalling those features, VS2015 update 3 still will NOT build UE 4.12.

I got fed up and said I’m going back to VS2013, so I did this:

  1. Run the command GenerateProjectFiles.bat -2013
  2. Open the project with VS2013
  3. Rebuild the project

And guess what, IT WORKS! Not a single error!

The only problem is that the compiled files are not compatible with the launcher game. They will work in a debugging session in VS.

VS2015 has more bugs then Windows 3.1! Epic before warned, you guys are going to see a lot more people complaining about this issue now that this is a official update to VS2015.