Code error when building Unreal Engine 5 Source Code in Visual Studio 2022

Matt Stein 5 Reputation points
2023-01-23T19:58:22.9833333+00:00

Hello!

Preword: I’m a newbie in this and looking to get started out and learn as much as I can.

I’m attempting to build the source code version of Unreal Engine 5 via Visual Studio and I’ve run into an error after building. Up to this point, I've followed Unreal Engine's documentation for setup and installed the files directly from their supported github directory, so I don't see a reason there would be an issue with the code I'm running.

After the build runs, Visual Studio comes back with a single failure:

Code: MSB3073 Desc: The command “…..\Build\BatchFiles\Build.bat - Target=“UnrealEditor Win64 Development” -Target=“ShaderCompileWorker Win64 Development -Quiet” -WaitMutex -FromMsBuild” exited with code 6. File: Microsoft.MakeFile.Targets Line: 44

As far as I could tell from my research, it seems like it’s a mismatch issue between local files and the code’s expected files, though I'm not super well versed in Visual Studio or C++ and am having a hard time figuring out the cause. The error is popping on the third line of the following code block (bolded):

  <Target Name="Build" DependsOnTargets="PrepareForNMakeBuild;ResolveReferences;GetTargetPath;$(PreNMakeBuildTarget)" Returns="$(NMakeManagedOutput)">
    <VCMessage Code="MSB8005" Type="Warning" Arguments="NMakeBuildCommandLine" Condition="'$(NMakeBuildCommandLine)'==''"/>
    
    <Exec Command="$(NMakeBuildCommandLine)" UseUtf8Encoding="Always" StdErrEncoding="UTF-8" StdOutEncoding="UTF-8" Condition="'$(NMakeUseOemCodePage)' != 'true' and '$(NMakeBuildCommandLine)'!=''"/>
  </Target>

Could anyone offer any guidance on what’s going on here? As far as I can tell I have all of the add-ons for Visual Studio that are required. I also tried to run the .sln file via VS2019 since that's a common one for running Unreal Engine 4, but UE5 doesn't seem to be supported on that version. Thank you!

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,614 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
941 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Matt Stein 5 Reputation points
    2023-01-25T15:09:33.6+00:00

    Solved: the file path that I'd cloned the source code to was too long. I re-cloned the project to a shorter file path and was able to successfully build. Thank you!

    1 person found this answer helpful.