Why is UBT failing to Generate Project Files?

Hello everyone,

I was previously working with Visual Studio 2012 and spent a lot of time trying to figure out how to get UE4 to compile under VS2012, finally resolving my issues after installing the DirectX SDK. Since then I’ve decided to upgrade to VS2013 and have started over with installing VS2013, resyncing UE4, and attempting to generate project files.

Unfortunately now I’m running into a problem with UBT attempting to generate project files, which is indicating that I need to have Windows SDK 8.0 installed in order to generate project files. I’ve attempting to install this 3 times but each time it keeps failing. I then installed Windows SDK 8.1 which I assumed would resolve my issue as it’s more recent, but unfortunately the issue with UBT is persisting even after installing Windows SDK 8.1. Do I specifically need Windows 8.0 SDK to get UBT to correctly generate my project files?

Hey ERW,

Can you post the a screenshot or log of the error you’re getting when you try to generate project files?

-Steve

Hi Steve,

Thanks for getting back to me on this. Since posting I was able to install the Windows 8.0 SDK (it’s unclear why it was failing before). Once the Windows 8.0 SDK installed properly, UBT is throwing the following error:

ERROR: SetEnvironmentVariablesFrombatchFile: BatchFile C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools../…/VC/bin/x86_amd64/vcvarsx86_amd64.bat does not exist!

Doing some Googling on this issue led me to believe that perhaps my VS120COMNTOOL environment variable was not set properly, or UBT might have been erroneously looking at VS110COMNTOOL. I confirmed my environment variable is pointing to the correct path (C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools), removed the VS110COMNTOOL env variable hoping this would resolve the issue but unfortunately that error is persisting.

EDIT: After removing the VS110COMNTOOL Env variable, I am receiving a new error message:

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

I have looked in Game/Engine/Programs/UnrealBuildTool/BuildConfiguration.xml for this setting but have not found where this property can be set yet.

Hi Steve,

I may be a little unclear on what you are asking, but I am attempting to generate my project files with the GenerateProjectFiles.bat.

It should be the full source version. However I have not yet updated to the very latest build of the engine due to these difficulties getting my installation setup with VS2013.

EDIT: Also Steve you may have missed it above but I edited a comment above here with some new error I am receiving relating to UBT. Appreciate the help so far!

Hey ERW,

Thanks for the follow-up info–are you trying to generate project files from the Launcher version of the Editor or are you using the GitHub version?

Just seeing if you are working with the Installed/Launcher version of the UE4 or if you are trying to use the GitHub full source version of UE4.

To break down the resolution for this problem for anyone who may encounter a similar issue: I was able to resolve my issues here by following these steps:

  1. Successfully installing Windows 8.1 SDK / Windows 8.0 SDK
  2. Ensuring that my VS120COMNTOOL environment variable was set to the correct path. Removing my VS110COMNTOOL environment variable
  3. Go to UnrealEngine\Engine\Source\Programs\UnrealBuildTool\Windows\UEBuildWindows.cs and editing this file, changing the line where the “WindowsCompiler Compiler” variable is declared to point to “WindowsCompiler.VisualStudio2013” rather than “WindowsCompiler.VisualStudio2012”

This seems to have resolved my issue and generating project files now successfully completes for me. Cheers!

Thanks Steve, appreciate the help.

Excellent, I was just getting to reply with where to change the WindowsCompiler Compiler variable, but glad you found it first!