Compile fails with " cannot open source file errors..."

After about 3 hours my compile fails with over 700 ‘cannot open source file’ errors! Starting with

cannot open source file ToolMenuContext.generated.h|UE4|D:\UnrealEngine-4.27\Engine\Source\Developer\ToolMenus\Public\ToolMenuContext.h|7||

Obviously I am not linking to necessary dependencies or frameworks. Can anyone help?

Also the documentation mentions taking only 10 - 40 minutes not 3 hours to compile!
“It may take anywhere between 10 and 40 minutes to finish compiling, depending on your system specs.”

Either you:

  • Are using an unsupported version of Visual Studio
  • Have your Engine in a protected directory and don’t have write access (i.e., Users/YourName/) - you can to run Visual Studio as an administrator or (the better option honestly) is to move your stuff out of those directories to some directory right off your HDD.
  • Somehow didn’t extract all the files from the engine src zip / tar ball.

EDIT: Also compile time is highly variable. I can compile things in ~45 minutes from scratch if everything is on an NvME drive.