Generate Visual studio project files

Decided to learn how to do C++ in Unreal 4 and mix it with my blueprints, the tutorial I am currently following wants me to “Generate Visual Studio project files” but doesn’t go over what it is or does.

Additionally whenever I do generate the files I get a error saying “failed to generate project files”
ERROR : UnrealBuildTool Exception: Unable to open log file for writing (C:\Users…)

Why is this?

Many Thanks and sorry if it is a stupid question.

I think it’s bug and it happens when you try to generate project file before attempting to opening project it self( but in general when Saved/Logs directory does not exist in project), you can easily fix that by trying to open the project (i think) or manually create Saved/Logs folder in your project folder

Generating project files does a rather simple thing: it generates a .sln file, which is basically a project file for Visual Studio. It takes all source code inside the Source folder and tells the .sln file “Those are your files”.

As for why it doesn’t work, there is a bug with the Unreal Build Tool right now (it is responsible for generating project data, among other responsibilities) which makes it bug out when it encounters a white space in your path; here, it probably encountered the white space between your first and last name.

To fix it, refer to the batch script I wrote in this thread:

You will probably have to google how to make a batch script out of the given code though, and tweak the paths there. When running this batch script, this whitespace error will not occur.

Hey Shadow,

Yeah looks like it’s a bug, going to try yours and Quexlaws suggestions now.
Thanks for letting me know by the way, for some reason I couldn’t find an answer and though I was doing something wrong. The comment below has linked a fix am going to try.

Thanks for the Link Quexlaw, I’ll make sure to give it a go the next time It is C++ practice day, was worrying I was doing something wrong for a moment.

Hey Quexlaw, I have been having the same issue as OP and then I came across your script.

Unfortunately, it throws up this warning for me:

C:\Program Files\Epic Games\UE_4.20\Engine\Source\ThirdParty\Expat\Expat.Build.cs: warning: Referenced directory ‘C:\Program Files\Epic Games\UE_4.20\Engine\Source\ThirdParty\Expat\expat-2.2.0\Win64\VS2015\Release’ does not exist.

And when I went to look at the directory expat-2.2.0 and there is no win64 folder inside. So I am assuming that is the issue.

What is causing this? I am 99% certain I installed VS correctly, following ue4 tutorials.

I think this error is unrelated as it references a third party library. I do not have that folder in there myself btw. You should create a new question.