An error occurred while trying to generate project files

Hello guys, I run into a known trouble with creating a c++ project.
I have searched here around, I found a few similar question but the solutions (in case they were there) didn’t fit my problem case.

The error log:
Running C:/Program Files/UnrealEngine4/Unreal Engine/4.8/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“S:/Documents/My work/C++/UnrealEngineCodeProjects/BeginnersUnluck/MyProject/MyProject.uproject” -game -rocket -progress
Discovering modules, targets and source code for game…
UnrealBuildTool Exception: ERROR: Failed to read environment variables from XML file: C:\Users\AppData\Local\Temp\tmp5C4.tmp

  1. Visual studio version 2013 Ultimate.
  2. Only VS12 environment variable is present, others are deleted.
  3. The paths do not contain any spaces.
  4. Blueprint project starts correctly.
  5. Tried to delete tmpXXX.tmp files and .bat files from AppData\Local\Temp folder, didn’t help
  6. Windows 8.1 SDK is up to date.

Hope to get some suggestions from u!
Thanks in advance!

Hi ,

Have you [checked out this post][1] on the forums? I posted a potential fix for this yesterday when I ran into issues with the PATH environment variable.

In short, try running the bat file that accompanies the tmp file, i.e run this in command prompt:

C:\Users\\AppData\Local\Temp\tmp5C4.tmp.bat

If you get any error that has a similar format to this, you might have a bad delimiter in the PATH environment variable (in my case, an extra quotation mark):

\Skype\Phone\ was unexpected at this time.

Results may vary - feel free to post the output of that command :slight_smile:

You will have to look through your PATH variable, and look for any unusual characters, or odd numbers of quotation marks and then remove them (Here be dragons, make a copy of the PATH environment string before editing). For everyone’s reference, you an get to the path environment variable like so:

https://forums.unrealengine.com/attachment.php?attachmentid=46878&d=1436326820

Okay, the next step I took to search through all in my opinion related environment variables directories.
Here is what I have so far:

//User PATH variable:
%Path%;%ANDROID_PLATFORM_TOOLS%;%ANDROID_TOOLS%;C:\Program Files\Java\jdk1.7.0_67;C:\Program Files (x86)\Google\google_appengine\

//System PATH varialble:
C:\MinGW\bin;C:\MinGW\msys\1.0\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Common Files\Autodesk Shared;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit;S:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft SQL Server\120\Tools\Binn;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.3 & MySQL Utilities 1.5.3 1.5;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5.3 & MySQL Utilities 1.5.3 1.5\Doctrine extensions for PHP;C:\Program Files (x86)\Skype\Phone;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\

//VS120COMNTOOLS:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\

//MYSQL_HOME:
C:\Program Files (x86)\MySQL\MySQL Server 5.6\bin**

I have looked it all throughout and I could not spot any weird characters… However, the “&” sign looks weird to me, but i’m not sure…

This is it so far… No luck :frowning:
And while I am constantly trying to re-create a C++ project over and over again to test my luck, I get always different *tmp file name in the error log.
Here is this nasty message:

I have tested something here. After performing all the suggested actions, including complete reinstall of all my VC components and visual studio itself, nothing started to work. As a gesture of the last hope I have removed engine version 4.8.1 and installed 4.7.6 instead. Everything worked as a charm. Apparently for my particular case this was the way to solve the problem. Either there is a big problem with 4.8 about reading environment variables or something is on my end, however I literally checked everything, well in case it was, the other engine version would not work as well. So, it’s closed for now. And thanks for help!

Hi , sorry for the late reply and sorry to hear! It could possibly be that pesky ampersand character (&) - but otherwise, I cannot see any extra delimiters within your PATH sys variable.

Did you try running the .bat file in a separate command prompt? It doesn’t matter if it’s a different bat file each time, UnrealBuildTool will autogenerate a new one each time :slight_smile:

Just asking, since command prompt will usually spit out either the error, or in my case, the section after the offending delimiter :smiley:

I have the exact same problem, 4.7.6 works fine, 4.8.3 does not compile C++ due to the same error. I was looking on github in the source file where I believe the error is generated, and it was last updated Jan 28. Not sure if it has changed since 4.7.6 (how can you check that?)

I assume you’ve found the location of the issue in the source of the Unreal Build Tool? You could just check out the 4.8 branch and do a diff with the same file on the 4.7 branch.