How Do I Make The VS2012 Buildfile Change?

The build tool tells me I have to change some variable somewhere to “2012”

I’ve looked everywhere for how to do this. I’ve looked in the buildtool’s batch files, I’ve read the readme, I’ve gone through all the GitHub commits, I’ve searched this site, I’ve searched the forums, I’ve searched Google, Bing, etc…

It’s been about 3 days since I got the sources off github.

Very frustrating.

I was able to do some hack job in some obscure Csharp source file to get it to build, but lots of things are broken elsewhere. I was hoping there would be some kind of official documentation on how to do this since the buildtool.bat file doesn’t tell us the file to edit (just a variable that could be in one of hundreds of different cs files).

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.

Well then, I guess I need to add something to my shopping list.

PS: What about Clang? I noticed some string literals here and there related to it in the build files. Is Clang used for XCode? I seriously doubt it’s officially supported, but a comparison between performances between it and VC++ would be interesting blog post.

It is actually on this hub a few times.

This was my question regarding compilation in Visual Studio 2012 and I’ve now got it all working.

To specifically answer your question:
Change line 28 of UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Windows\UEBuildWindows.cs to

public static readonly WindowsCompiler Compiler = WindowsCompiler.VisualStudio2012;

and then run the batch file to generate project files.

You must download the optional ZIP file from GitHub. Also install the DirectX runtime it requests as that can cause obscure errors if missing (this was my issue). Even when you do get it all compiled you will need to install Visual Studio 2013 runtimes (if not already installed) as some DLLs seem to rely on then.

There is still capability in the UBT to generate Visual Studio 2012 projects and solutions, just use the command line parameter, “-2012” when calling the GenerateProjects batch file, that will generate project and solution files for VS2012.

Cheers,
Nick (Epic Games)

Great comment, very complete answer.

I should add that the DirectX redist can be found as part of the Unreal Engine install.

C:\Program Files\Unreal Engine\DirectXRedist\

…The readme does state that VS2012 is supported, with a code change.

I found that it’s also useful to install the 12 (2013) Build Tools.

That is, instead of fiddling with your paths to use the 2012 tools and running into strange bugs because of it, just install the 2013 tools.