# What's the header file to make the pointer to GEngine work?

**URL:** <https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249>\
**Category:** Modding\
**Tags:** unreal-engine, pointer, question\
**Created:** [August 17, 2014, 4:38pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249 "2014-08-17T16:38:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DrHobo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DrHobo](https://forums.unrealengine.com/u/DrHobo)\
**Post date:** [August 17, 2014, 4:38pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/1 "2014-08-17T16:38:45Z")

</div>

I usually compile the engine from GitHub, but I decided to give it a shot with 4.4 and found out that’s all my efforts to make GEngine point to something fails. You know, as in

```
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Green, TEXT("Hit"));

```

What’s the correct header for it ?

---

<div class="post-metadata">

**Author:** ![DrHobo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DrHobo](https://forums.unrealengine.com/u/DrHobo)\
**Post date:** [August 17, 2014, 4:53pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/2 "2014-08-17T16:53:36Z")

</div>

Answering my own question. It’s

```
  #include "Engine.h"

```

😛

---

<div class="post-metadata">

**Author:** ![Leviboy98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leviboy98](https://forums.unrealengine.com/u/Leviboy98)\
**Post date:** [August 29, 2017, 5:36pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/3 "2017-08-29T17:36:58Z")

</div>

It doesnt work for me ☹

---

<div class="post-metadata">

**Author:** ![DrHobo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DrHobo](https://forums.unrealengine.com/u/DrHobo)\
**Post date:** [September 7, 2017, 12:19pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/4 "2017-09-07T12:19:21Z")

</div>

Care to share your code and the output it produces ?

---

<div class="post-metadata">

**Author:** ![Leviboy98](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Leviboy98](https://forums.unrealengine.com/u/Leviboy98)\
**Post date:** [September 7, 2017, 5:36pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/5 "2017-09-07T17:36:48Z")

</div>

Its just a blank plugin.

---

<div class="post-metadata">

**Author:** ![Weibye](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Weibye](https://forums.unrealengine.com/u/Weibye)\
**Post date:** [November 25, 2018, 6:55pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/6 "2018-11-25T18:55:37Z")

</div>

Newest updated answer as pointed out by [drichardson](https://answers.unrealengine.com/users/460235/view.html) below.

`#include Engine/Engine.h`

Disregard what is written below the line, as it is an old answer.

* * *

Updated answer as of 4.21:

`#include "Runtime/Engine/Classes/Engine/Engine.h"`

> **[UEngine::AddOnScreenDebugMessage](https://docs.unrealengine.com/5.0/en-US/API/Runtime/Engine/Engine/UEngine/AddOnScreenDebugMessage/1/)**
>
> Add a \[FString\](API\\Runtime\\Core\\Containers\\FString) to the On-screen debug message system.

---

<div class="post-metadata">

**Author:** ![Doug\_Richardson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Doug\_Richardson](https://forums.unrealengine.com/u/Doug_Richardson)\
**Post date:** [February 4, 2019, 7:11pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/7 "2019-02-04T19:11:28Z")

</div>

According to the [IWYU](https://docs.unrealengine.com/en-us/Programming/UnrealBuildSystem/IWYUReferenceGuide) (include what you use) page, you’re supposed to include “Engine/Engine.h” for the new streamlined header. While both the include you gave and “Engine/Engine.h” work now, you’re probably better protected from future changes in file location by using “Engine/Engine.h” since the module owner could move the file around without breaking anyone.

---

<div class="post-metadata">

**Author:** ![Weibye](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Weibye](https://forums.unrealengine.com/u/Weibye)\
**Post date:** [February 22, 2019, 3:01pm UTC](https://forums.unrealengine.com/t/whats-the-header-file-to-make-the-pointer-to-gengine-work/291249/8 "2019-02-22T15:01:14Z")

</div>

Good point, thanks. Updated answer.
