Linux UE4 Build Precompiled Header Fatal Error

Hello Everyone,

Basically when I build the Unreal Editor, on Linux, two errors occur: file Core.h is missing and files have been modified since a precompiled header was built.

The first error, the missing Core.h file, was asked in another UE4 AnswerHub question - https://answers.unrealengine.com/questions/412038/linux-build-coreh-file-not-found.html - and therefore the focus of this question will be on the second error, the precompiled header.

I believe these errors are not interrelated.


Context:

Unreal Engine: 4.11

OS: Ubuntu 14.04

IDE: Qt Creator v 3.6.0; Qt v 5.5.1

Unreal Engine has been successfully built on Linux, following the wiki guide (https://wiki.unrealengine.com/Building_On_Linux)

Qt Creator plugin has been built (GitHub - fire/QtCreatorSourceCodeAccess) and “Salamander Rake’s” video guide has been followed (- YouTube).

I’m following the tutorial on the Github - Epic - UnrealEngine 4.11 - Readme: https://github.com/EpicGames/UnrealEngine/blob/4.11/Engine/Build/BatchFiles/Linux/README.md

I’m using this tutorial to import the generated project file (UE4.pro) into an IDE, in this case Qt Creator, but I do not believe the IDE is the cause of the problem below.


Objective

Establish an environment to develop a modified version of the Unreal Engine (modify the source code on github) on and for Linux.


Problem

When I try to follow the following steps, from the tutorial on the Github Readme (as mentioned above):

"

Alternatively, build the following targets:

make CrashReportClient ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor

"

Two errors occur.


Compile Output/Error

make argument: CrashReportClient

fatal error: file ‘/usr/include/x86_64-linux-gnu/asm/unistd.h’ has been modified since the precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Development/Core/CorePrivatePCH.h.gch’ was built
note: please rebuild precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Development/Core/CorePrivatePCH.h.gch’

make: *** [CrashReportClient] Error 5
16:40:46: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project UE4 (kit: Unreal Engine 4_Kit)
When executing step “Make”


This error is directly an effect of the make arguments. If I remove the CrashReportClient from the make argument (Therefore leaving it to be: ShaderCompileWorker UnrealLightmass UnrealPak UE4Editor UE4Game), the error which appears is:

make argument: ShaderCompileWorker

fatal error: file ‘/usr/include/linux/sysctl.h’ has been modified since the precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/ShaderCompileWorker/Development/Core/CorePrivatePCH.h.gch’ was built
note: please rebuild precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/ShaderCompileWorker/Development/Core/CorePrivatePCH.h.gch’

make: *** [ShaderCompileWorker] Error 5
18:16:33: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project UE4 (kit: Unreal Engine 4_Kit)
When executing step “Make”


For Completeness, here are the other errors that appear for the other make arguments:


make argument: UnrealLightmass

fatal error: file ‘/usr/include/linux/sysctl.h’ has been modified since the precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealLightmass/Development/Core/CorePrivatePCH.h.gch’ was built
note: please rebuild precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealLightmass/Development/Core/CorePrivatePCH.h.gch’

make: *** [UnrealLightmass] Error 5
18:29:51: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project UE4 (kit: Unreal Engine 4_Kit)
When executing step “Make”


make argument: UnrealPak

fatal error: file ‘/usr/include/linux/version.h’ has been modified since the precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealPak/Development/Core/CorePrivatePCH.h.gch’ was built
note: please rebuild precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealPak/Development/Core/CorePrivatePCH.h.gch’

make: *** [UnrealPak] Error 5
18:31:20: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project UE4 (kit: Unreal Engine 4_Kit)
When executing step “Make”


make argument: UE4Game

fatal error: file ‘/usr/include/linux/version.h’ has been modified since the precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UE4/Development/Core/CorePrivatePCH.h.gch’ was built
note: please rebuild precompiled header ‘/home/mynewuser/Downloads/UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UE4/Development/Core/CorePrivatePCH.h.gch’

make: *** [UE4Game] Error 5
18:33:41: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project UE4 (kit: Unreal Engine 4_Kit)
When executing step “Make”


These errors do not occur only when the make argument is solely: UE4Editor

These errors are occur independent of being single (i.e. make argument: UnrealPak) or composed arguments (i.e. make argument: UnrealPak UE4Game …).

Full Compile Output of one of these errors is in attachment. I believe there isn’t a reason to put all logs here because what changes between them are the lines of error shown above.

Full Compile Output Error Log


Similar Questions (but answers not applicable to this problem)

  1. Mageia forum • View topic - Unreal Engine 4.9 On Linux [SOLVED]
  2. info.plist - Fixing file 'project.pch' has been modified since the precompiled header was built error in Xcode - Stack Overflow

Obs 1 - The answer offered here was to switch hard drives, but I doubt this is the solution because in the case presented the developer upgraded to an 120GB HDD and my HD is 500GB.

Obs 2 - This one seems like a possible solution, but I would need to know which folder cache to empty out. If possible I would like to use the ARGS = “-clean” argument because it deletes almost all of the editor, as shown here - https://answers.unrealengine.com/questions/403173/linux-qt-creator-hanging-when-debugging.html


If there is any additional information that must be provided, please let me know and I will provide it.

Thank you very much for your inputs.

Ivan

You were probably building those targets in the past, kept generated precompiled header files (which include system headers), and have since updated the system headers (during e.g. system update). This means that you now need to build from scratch - either by passing ARGS=-clean or by deleting Intermediate subdirectory(-ies) manually.

Hello RCL.

First of all, thank you for your input.

I have tried passing ARGS=-clean, but the missing Core.h error I mentioned above and also in another Answer Hub Question ( https://answers.unrealengine.com/questions/412038/linux-build-coreh-file-not-found.html ) appears.

In attachment is the Compile Output Log.

Clean Error Log

Do you know a solution to this matter?

Thank you for your help.

Ivan

Could you please that your source directory is complete and Core.h file is indeed there? Alternatively, could you check out the repository in a new place and attempt to build the same targets from scratch?

Thank you for your reply and inputs.

I have checked the source directory, it is complete, and the Core.h files are in 4 locations (before and after this error occurs), are also the same before and after the error appears:

  1. /UnrealEngine/Engine/Source/Runtime/Core/Public/Core.h
  2. /UnrealEngine/Engine/Source/ThirdParty/llvm/3.5.0/include/llvm-c/Core.h
  3. /UnrealEngine/Engine/Source/ThirdParty/llvm/3.6.2/include/llvm-c/Core.h
  4. /UnrealEngine/Engine/Source/ThirdParty/SpeedTree/SpeedTreeSDK-v7.0/Include/Core/Core.h

I do not know why this was caused, but I did find a solution to the error though, see the answer below.

I have resolved the error. Thank you RCL for your answer, I had to modify a bit of your suggestion to come to the solution to my problem.


Precompiled Header Files Error [Solution]

As RCL mentioned, precompiled header files were kept from previous build and system header files were built after this, which caused the error.

The solution is to Clean the respective CorePrivatePCH.h.gch files from each of the folders whos make steps caused errors (in this case: CrashReportClient, ShaderCompileWorker, UnrealLightmass, UnrealPak, UE4Game). This clean process can be done in two ways, either manually deleting the files or executing a clean step.

Both options are explained below.

There may be more options available, and even better ones, but these are the two I have come up with so far. I prefer Option one because of the less time that it takes.


Option 1 - Manually Deleting Respective CorePrivatePCH.h.gch files

Make Argument (which caused error) = File to Delete to fix error

CrashReportClient = /UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/CrashReportClient/Development/Core/CorePrivatePCH.h.gch

ShaderCompileWorker = /UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/ShaderCompileWorker/Development/Core/CorePrivatePCH.h.gch

UnrealLightmass = /UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealLightmass/Development/Core/CorePrivatePCH.h.gch

UnrealPak = /UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UnrealPak/Development/Core/CorePrivatePCH.h.gch

UE4Game = /UnrealEngine/Engine/Intermediate/Build/Linux/B4D820EA/UE4/Development/Core/CorePrivatePCH.h.gch

After deleting these files, execute the make step (build) with the following arguments: CrashReportClient ShaderCompileWorker UnrealLightmass UnrealPak UE4Game

Files will now be compiled without any errors.

Time to Build = aproximately 5min.


Option 2 - Executing Clean Steps to delete CorePrivatePCH.h.gch files

Note: This step will delete many files, more than just the needed files, so it will therefore take longer to build afterwards.

Clean Step Arguments: CrashReportClient ShaderCompileWorker UnrealLightmass UnrealPak UE4Game ARGS="-clean"

After deleting these files, execute the make step (build) with the following arguments: CrashReportClient ShaderCompileWorker UnrealLightmass UnrealPak UE4Game

Time to Build = aproximately 37min.


Thank you again RCL for your answer, with it I was able to adjust it to my specific error and come to a specific resolution.

Ivan

I have partly resolved the missing Core.h error. I have posted the answer here - https://answers.unrealengine.com/questions/412038/linux-build-coreh-file-not-found.html#answer-412881

Thank you again RCL for your answer and help.

The precompiled issues appears either when you:

  1. Update your kernel headers (Updates of your distro).
  2. Update to newer version of Unreal Engine.

In both cases I would recommend remove your Engine/Intermediate folder. That will include you to recompile everything from the beginning which you will have to anyway when you are developing C++ projects with UE4. Sooner or later it will cause an compile error again. I wouldn’t mess around with removing only specific subfolders in the Engine/Intermediate. Yes you should recompile everything again.
You might consider not to update your kernel to frequent.

gracias, UE 4.15.1 in openSUSE 42.2

Just remove the precompiled “.gch” header file from the location where it is present(the location should be available in the logs). Then try rebuilding again. It should work fine now,