C++ error: The project could not be compiled. Would you like to open it in Visual Studio?

I have been trying to create a C++ project in UE4 but henever i do i get what is said in the title with the error:
Unable to rename C:\Users\HOME\Documents\Unreal Projects\Testproject\Intermediate\Build\Win64\TestprojectEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h.txt.tmp to C:\Users\HOME\Documents\Unreal Projects\Testproject\Intermediate\Build\Win64\TestprojectEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h.txt

I understand this might be a common issue but no solutions have worked. I’ve been on the Visual Studio modify and applied all the necessary components. To anyone that trys to help, Thank you.

Hi! Somebody from my team just had the exact same issue. It appears to have been caused by their antivirus software, preventing the file mentioned in the error message to be renamed.
I’d advise you to completely disable the antivirus while you are building.
I’ve read similar errors can also be caused by special characters in the file path, or the path being too long (over 260)
Hope this helps, cheers! :slight_smile:


Move your project out of your Documents directory, it can also be a permissions issue.

Totally worked thank you !!

Worked by disabling my antivirus, thanks a lot…