# Precompiled definitions are not fooling your pch thingy

**URL:** <https://forums.unrealengine.com/t/precompiled-definitions-are-not-fooling-your-pch-thingy/19773>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [January 28, 2015, 1:07am UTC](https://forums.unrealengine.com/t/precompiled-definitions-are-not-fooling-your-pch-thingy/19773 "2015-01-28T01:07:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimmyt1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jimmyt1988](https://forums.unrealengine.com/u/jimmyt1988)\
**Post date:** [January 28, 2015, 1:07am UTC](https://forums.unrealengine.com/t/precompiled-definitions-are-not-fooling-your-pch-thingy/19773/1 "2015-01-28T01:07:43Z")

</div>

I have added a Precompiled definition to my project:

```auto

JIMMYT1988_CONFIG_INCLUDE="$(SolutionDir)Source\TemplatePlatformer\Public\TemplatePlatformer.h"

```

The reason is that all my cpp files have to have that pch included… including my project hetrogeneous code… that’s why i wanted to have one configuration file that knew where the pch is for the project, and just call that macro instead:

for example:

this:

_MyClass.cpp_

```auto

#include "./../../../Public/TemplatePlatformer.h"
#include "MyClass.h"

...

```

_MyClass2.cpp_

```auto

#include "./../../../Public/TemplatePlatformer.h"
#include "MyClass2.h"

...

```

would become this:

_MyClass.cpp_

```auto

INCLUDE_CONFIG
#include "MyClass.h"

...

```

_MyClass2.cpp_

```auto

INCLUDE_CONFIG
#include "MyClass2.h"

...

```

This is not fooling the pch though, i’m still getting this \*\*\*\* error:

```auto

Error	6	
error : All source files in module "TemplatePlatformer" must include the same precompiled header first.  
Currently "E:\Documents\Unreal Projects\TemplatePlatformer\Source\TemplatePlatformer\Public\TemplatePlatformer.h" is included by most of the source files.  
The following source files are not including "E:\Documents\Unreal Projects\TemplatePlatformer\Source\TemplatePlatformer\Public\TemplatePlatformer.h" as their first include:	
E:\Documents\Unreal Projects\TemplatePlatformer\Intermediate\ProjectFiles\EXEC	TemplatePlatformer

Error	7	
error MSB3073: The command "
"C:\Program Files\Unreal Engine\4.6\Engine\Build\BatchFiles\Rebuild.bat" 
TemplatePlatformerEditor Win64 DebugGame 
"E:\Documents\Unreal Projects\TemplatePlatformer\TemplatePlatformer.uproject" -rocket
" exited with code 2.	C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.MakeFile.Targets	

43	5	TemplatePlatformer

```

---

<div class="post-metadata">

**Author:** ![jimmyt1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@jimmyt1988](https://forums.unrealengine.com/u/jimmyt1988)\
**Post date:** [January 28, 2015, 1:23am UTC](https://forums.unrealengine.com/t/precompiled-definitions-are-not-fooling-your-pch-thingy/19773/2 "2015-01-28T01:23:12Z")

</div>

This was the issue: [Compilation error when referencing ULocalPlayer - C++ - Unreal Engine Forums](https://answers.unrealengine.com/questions/155965/compilation-error-when-referencing-ulocalplayer.html)

I removed the include in one of my files: “LocalPlayers.h”

and replaced with “Engine.h”

phewwioeee, that was a \*\*\*\* error 😃
