# Can't include Object.h and Delegate.h

**URL:** <https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727>\
**Category:** Plugins\
**Tags:** compilation-error, unreal-engine, Plugins, question, CPP\
**Created:** [July 19, 2018, 1:33am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727 "2018-07-19T01:33:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [July 19, 2018, 1:33am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/1 "2018-07-19T01:33:07Z")

</div>

I am trying to compile my plugins for 4.20  
But I have fatal errors (can not open include file) on:

```
#include "Object.h"
#include "Delegate.h"

```

Any ideas?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [July 19, 2018, 4:28am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/2 "2018-07-19T04:28:56Z")

</div>

Why you incuding those instead just including base class header file?

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [July 19, 2018, 4:31am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/3 "2018-07-19T04:31:51Z")

</div>

Well I don’t know - it worked fine in previous engines

what is the base header file ?

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [July 19, 2018, 4:47am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/4 "2018-07-19T04:47:01Z")

</div>

Normally you don’t need to include those. by base class header file i mean header file contain deceleration of base class you using in this header, for example if you use AActor as base class then you shoud include “GameFramework/Actor.h”. Header fiels include other headerfiles which effectivly be included in your header file, by including base class header file you will have all includes nessesery needed to support your base class already done, thats what class generator does in editor too. There some forward declarations which require you to include extra header files in cpp file, you do that when you get “Incomplete deceleration” error

---

<div class="post-metadata">

**Author:** ![Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Anonymous\_e5d5c0bf7d300728867097ff79906dbe](https://forums.unrealengine.com/u/Anonymous_e5d5c0bf7d300728867097ff79906dbe)\
**Post date:** [July 19, 2018, 4:59am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/5 "2018-07-19T04:59:12Z")

</div>

Well obviously I included the base class…  
“Components/ActorComponent.h” in my case.

But, without including the Delegate.h (Which I found solution for now is to use #include “Delegates/Delegate.h” which is super awkward change that I hate with everything inside me.

---

<div class="post-metadata">

**Author:** ![PlayHabits](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/playhabits/32/748494_2.png) [@PlayHabits](https://forums.unrealengine.com/u/PlayHabits)\
**Post date:** [February 28, 2023, 12:58am UTC](https://forums.unrealengine.com/t/cant-include-object-h-and-delegate-h/429727/6 "2023-02-28T00:58:21Z")

</div>

Try this:  
#include “UObject/Object.h”  
#include “Delegates/Delegate.h”
