Unable to build UE4 from source

I have downloaded the Release version of the engine from Github and am attempting to follow the instructions in this documentation:

When I get to step 5 (Build UE4), I get the following errors:

1>------ Build started: Project: ShaderCompileWorker, Configuration: Development_Program x64 ------

1>The system cannot find the path specified.

1>E:\Microsoft Visual Studio\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat ShaderCompileWorker Win64 Development -waitmutex” exited with code 3.

1>Done building project “ShaderCompileWorker.vcxproj” – FAILED.

2>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------

2>The system cannot find the path specified.

2>E:\Microsoft Visual Studio\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat UE4Editor Win64 Development -waitmutex” exited with code 3.

2>Done building project “UE4.vcxproj” – FAILED.

========== Build: 0 succeeded, 2 failed, 2 up-to-date, 0 skipped ==========

Does anyone know what might be causing this? Any suggestions would be much appreciated.

That’s weird, Try first build “ShaderCompileWorker”

Thanks, I just tried that but no luck:

1>------ Build started: Project: ShaderCompileWorker, Configuration: Development_Program x64 ------
1>The system cannot find the path specified.
1>E:\Microsoft Visual Studio\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…..\Build\BatchFiles\Build.bat ShaderCompileWorker Win64 Development -waitmutex” exited with code 3.
1>Done building project “ShaderCompileWorker.vcxproj” – FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========

Ok, update. So I managed to build the engine by running Build.bat UE4Editor Win64 Development, as suggested in this post:

But I still can’t open the editor. If I attempt to run Local Windows Debugger, it says that ShaderCompileWorker is out of date, and prompts me to rebuild it. But the build fails:

1>Done building project “ShaderCompileWorker.vcxproj” – FAILED.

2>------ Build started: Project: UE4, Configuration: Development_Editor x64 ------

2>The system cannot find the path specified.

2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command “…\Build\BatchFiles\Build.bat UE4Editor Win64 Development -waitmutex-2017” exited with code 3.

2>Done building project “UE4.vcxproj” – FAILED.

3>------ Skipped Deploy: Project: ShaderCompileWorker, Configuration: Development_Program x64 ------

3>Project not selected to build for this solution configuration

========== Build: 0 succeeded, 2 failed, 2 up-to-date, 0 skipped ==========

========== Deploy: 0 succeeded, 0 failed, 1 skipped ==========

If I attempt to launch the editor without building ShaderCompileWorker, it obviously just throws up an error saying it was unable to launch ShaderCompileWorker.exe.

Any other ideas?

I figured this out. Still not sure why the pathing issue occurred, but you can use Build.bat to build the engine outside of Visual Studio. If ShaderCompileWorker is not built, you can use Build.bat to build ShaderCompileWorker too. This worked for me.

Adding for beginners like me. Command to run the Build.bat

.\Build.bat UE4Editor Win64 Development

Location for Build.bat:

C:\UnrealEngine\Engine\Build\BatchFiles