VS 2015 build error - C++ project - UE4 4.14.1

Hello,

I started the beginner C++ tutorials on YouTube 2 days ago and created my first project on UE4 with VS 2015 Enterprise.

I cannot build, rebuild or clean the project from VS,although it is an empty project still. I am getting the following 2 errors:

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: LearningProject2, Configuration: DebugGame_Editor x64 ------
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3073: The command ““C:\Program Files (x86)\Epic Games\4.14\Engine\Build\BatchFiles\Build.bat” LearningProject2Editor Win64 DebugGame “C:\Users\Sh\Documents\Unreal Projects\LearningProject2\LearningProject2.uproject” -waitmutex” exited with code -1073741819.

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3073: The command “@rem Nothing to do.” exited with code -1073741819.
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========

The steps I took so far:

  • Run as administrator
  • changed to DebugGame Editor
  • Added to my project VC++ directories->Include Directories (inherit from parent)
  • edited Rebuild.bat file by changing %~dp0 to %~dp0s as someone suggested it might be the spaces in path (changed back now)

When I click on any of the 2 errors, it refers to Microsoft.MakeFile.Targets
The following line of code:

     <Exec Command="$(NMakeBuildCommandLine)"  Condition="'$(NMakeBuildCommandLine)'!=''"/>

Please advise what can be the issue, I have little knowledge in C++ and no previous knowledge of UE or games development in general

Thank you!

For those coming here with the same problem:

It turned out that I needed to “Open Connection to a Perforce Depot” under File because I was timed-out from my Perforce server. After it reconnected everything was good again.