UE4 Compile failed when loading C++ Project

Hi all,

Just trying to follow a tutorial. Have installed UE4 and am trying to start a side-scroller project which uses C++ rather than Blueprints.

After setting project name “Fight” and starting the project, this happens:

Running C:/Program Files/UE_4.26/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="C:/Users/Chris/Documents/Unreal Projects/Fight/Fight.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Creating makefile for FightEditor (no existing makefile)
@progress push 5%
Parsing headers for FightEditor
  Running UnrealHeaderTool "C:\Users\Chris\Documents\Unreal Projects\Fight\Fight.uproject" "C:\Users\Chris\Documents\Unreal Projects\Fight\Intermediate\Build\Win64\FightEditor\Development\FightEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -abslog="C:\Users\Chris\AppData\Local\UnrealBuildTool\Log_UHT.txt" -installed
Reflection code generated for FightEditor in 4.4050129 seconds
@progress pop
Building FightEditor...
Using Visual Studio 2019 14.28.29336 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 11 actions with 12 processes...
  @progress 'Compiling C++ source code...' 0%
  @progress 'Compiling C++ source code...' 9%
  [1/11] Default.rc2
  @progress 'Compiling C++ source code...' 18%
  [2/11] SharedPCH.Engine.ShadowErrors.cpp
  ERROR: Unable to rename C:\Users\Chris\Documents\Unreal Projects\Fight\Intermediate\Build\Win64\FightEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h.txt.tmp to C:\Users\Chris\Documents\Unreal Projects\Fight\Intermediate\Build\Win64\FightEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h.txt   

Sorry for the text mess there.

From googling, usually this issue is because the file path contains non-English characters, usually in the User profile… But my name on this is Chris… So I don’t know what the problem is.


Hi! This looks similar to this post: C++ error: The project could not be compiled. Would you like to open it in Visual Studio? - C++ Programming - Unreal Engine Forums

TLDR: Try disabling your antivirus while building the project, move project out of Documents directory, check file path for special characters or length over 260.

Hope this helps, cheers!