"Cannot open include file ..." errors when building a project using the source version of the engine

When compiling my project using a source build of Unreal (5.2.1), I receive a huge number of “cannot open include file” errors. It says that it can’t find these files, even though they exist. But for whatever reason, it generates the include path wrong, missing the first folder, like “Runtime/” or “Developer/”. If I manually go through each file and manually correct each path, I receive a different build error.

All of the errors are in the engine code, not in my project code. When I compile the engine by itself, it compiles fine. It’s only when I try to compile the project that the engine code complains.

I’ve tried deleting and building, rebuilding, cleaning, regenerating project files, etc. for both the engine source code and the project, but nothing has changed. The weirdest part is that on other machines, I’ve pulled the engine source and the project and both have compiled without problems.

I’d really appreciate any advice anyone has to fix this!

Hey,

Can you try to delete “BuildConfiguration.xml” files in below folders.
Since different Unreal versions can use same folders such as Appdata, you may have previous settings from early versions. I’m not sure if this is related to your case but it seems Unreal does not like Unity builds starting from Unreal 5.2.

  • Engine/Saved/UnrealBuildTool/BuildConfiguration.xml
  • User Folder/AppData/Roaming/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml
  • My Documents/Unreal Engine/UnrealBuildTool/BuildConfiguration.xml

I had a topic about this, you may want to check.