GenerateProjectFiles.bat fails for VS2012 because of UnrealBuildTool set to 2013

GenerateProjectFiles.bat failed when I only have VS2012 installed. It says to modify a variable in UnrealBuildTool.

Exact output:

UnrealBuildTool Exception: ERROR: Visual Studio 2013 must be installed in order to build this target. However, Visual Studio 2012 was detected. To compile with Visual Studio 2012, change the ‘WindowsPlatform.Compiler’ variable in UnrealBuildTool

Go to UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Windows\UEBuildWindows.cs

Line 27/28 says:

/// Version of the compiler toolchain to use on Windows platform
public static readonly WindowsCompiler Compiler = WindowsCompiler.VisualStudio2013;

Change that to

public static readonly WindowsCompiler Compiler = WindowsCompiler.VisualStudio2012;

Now re-run GenerateProjectFiles.bat and it should work fine.

I hope I’m not being rude, but if vs2012 is supported things should at least work via command line switches, or at least place a link to the instructions somewhere in the “getting started” documentation.

I’ve spent the better part of 3 hours searching various forums/search engines for this solution, and I’m a seasoned IT support staffer / CS alumni / Linux build-monkey. I hate to imagine what the artists and designers just wanting to learn the Blueprint system are going through.

Hi Bleakwise, not at all. We want to hear of your frustrations so we can fix them up.

We advertise that our users need VS 2013 for UE4, but folks are able to make some code changes to still support VS 2012. While we try and direct users towards VS 2013 for a better experience, agreed that the workaround for VS 2012 support could be more visible.

And one note - Visual Studio isn’t a requirement for artist, designers, or anyone not needing to make code changes.

Hi DanYouhon,

You can generate Visual Studio 2012 solution and project files by passing -2012 to GenerateProjectFiles.bat. Sorry it gave you such an unhelpful error message.

Cheers,
Nick (Epic Games)

Thanks! I think it’d be helpful to a lot of people for one centralized place (maybe on the docs or Wiki?) for a “VS2012 guide”. It seems to be all scattered, one place mentioned you need to have Optional.zip file, another said you needed to modify code, and no where did the -2012 flag get mentioned.

I definitely understand wanting to focus on VS2013 and forward, but for me I have 2012 and am evaluating UE4 to see if the extra $300 to upgrade is worth it.

Also, while re-installing UE4 on a new computer, I found that the -2012 flag for GenerateProjectFiles.bat doesn’t work, has the same warning.