Failed to build using the basic template in vs2017

Hi,

I always wanted to get into game dev and wanted to start learning ue4. But I can’t seem to build anything using c++ (similar error with rebuild/clean solution), including a fresh basic template. I have searched answers for days, and have tried various things such as

  1. renaming environment variable path and PATH to not include spaces

  2. making sure desktop development with c++, game development with c++, windows 8.1 and 10 sdk were installed

  3. including the path of the ue4 build .bat files found at “\Engine\Build\BatchFiles” in the PATH environment variable

  4. right clicking project and selecting “generate visual studios project files”

  5. Changing my windows 7 username to a name without special characters

  6. including quotations for NMake found under the project solutions configuration properties

ex: Build Command Line reads exactly “D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” MyProjectEditor Win64 Development “$(SolutionDir)$(ProjectName).uproject” -waitmutex

The error given:

D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 Development "D:\VisualStudCompileTest\MyProject\MyProject.uproject" -waitmutex" exited with code 1.
  0 Warning(s)
  1 Error(s)

  Time Elapsed 00:00:00.48
  ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped

Here’s the part of output that I think is the main cause of the build failure

Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
  Task "Exec"
   Task Parameter:Command="D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 Development "D:\VisualStudCompileTest\MyProject\MyProject.uproject" -waitmutex
    "D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 Development "D:\VisualStudCompileTest\MyProject\MyProject.uproject" -waitmutex
    'C:\Users\' is not recognized as an internal or external command,
    operable program or batch file.
    D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ""D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat" MyProjectEditor Win64 Development "D:\VisualStudCompileTest\MyProject\MyProject.uproject" -waitmutex" exited with code 1.
  Done executing task "Exec" -- FAILED.
Done building target "Build" in project "MyProject.vcxproj" -- FAILED.

I think the issue might be that it can’t identify/execute .bat or something

'C:\Users\' is not recognized as an internal or external command,
operable program or batch file.

Interestingly, if i were to cmd>navigate to where ue4 build.bat file is using command cd> and enter

“D:\Program Files\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” MyProjectEditor Win64 Development “$(SolutionDir)$(ProjectName).uproject” -waitmutex

It will accept the command and complete without errors

Here’s the full visual studio output

output.txt

Sry for the long post, I’m currently using Visual Studios 2017. Thank you in advanced, any help is appreciated :slight_smile:

Hey IAmThrowing,

I understand that you’ve made sure windows sdk 8.1 and 10 were installed, but have you tried completely uninstalling Visual studio 2017, and then reinstalling? It could be a corrupt install of VS2017.

Hi Nicholas, I have reinstalled vs2017 and the newest ue4 engine. It didn’t correct the problem above, but compiling c++ from the ue4 menu seems to work now. I think for now I’ll work with that, thanks :slight_smile:

Reinstalled vs2017 and newest ue4 engine. Can compile c++ from within UE4 now instead of using Vs2017

I’m having this problem with Visual Studio Code, i could compiling normally in VS 2017.