# How to recompile specific PCH.h file?

**URL:** <https://forums.unrealengine.com/t/how-to-recompile-specific-pch-h-file/437134>\
**Category:** C++\
**Tags:** header, engine-compile, unreal-engine, UE4, question, CPP\
**Created:** [November 6, 2018, 2:53pm UTC](https://forums.unrealengine.com/t/how-to-recompile-specific-pch-h-file/437134 "2018-11-06T14:53:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_e5f624c2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e5f624c2](https://forums.unrealengine.com/u/anonymous_user_e5f624c2)\
**Post date:** [November 6, 2018, 2:53pm UTC](https://forums.unrealengine.com/t/how-to-recompile-specific-pch-h-file/437134/1 "2018-11-06T14:53:55Z")

</div>

Hi all,

I really often have an error like the one below:

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

In order to solve this error, what I normally do is **REMOVE ALL .gch** files with:

```
for f in $(find /path/to/Unreal -name "*.gch"); do rm -v $f ; done 

```

After this I compile the project again. Although this approach works, the compilation takes ages, because undoubtedly I’m removing .gch files that don’t need to be removed.

What I would like to do is recompiling only those specific PCH.h files independently, so that when compiling my project I won’t have this error.

**Is there a way to recompile only specific .h files in Unreal?**

Thank you very much for any help.

## PS:

Only removing those specific .gch files won’t solve my problem because if I remove one and compile my project again, after 10 minutes compiling clang will probably complain about a different .gch file which needs to be rebuilt.

What I’m planning to do is creating a `test_X_.cpp` for each `PCH.h` file ( `_X_` is the name of the PCH.h file)

Each `test_X_.cpp` would be compiled before compiling my project to detect whether a specific PCH.h file needs to be recompiled.  
The `test_X_.cpp` would contain only the header file. Something like:

```
#include "_X_.h"
int main() { return 0; }

```
