# Why does one of my declarations produce an error, while its twin works fine?

**URL:** <https://forums.unrealengine.com/t/why-does-one-of-my-declarations-produce-an-error-while-its-twin-works-fine/327456>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [August 3, 2015, 5:26am UTC](https://forums.unrealengine.com/t/why-does-one-of-my-declarations-produce-an-error-while-its-twin-works-fine/327456 "2015-08-03T05:26:23Z")\
**Posts on this page:** 2\
**Page:** 2

<div class="post-metadata">

**Author:** ![theonecalledtom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theonecalledtom](https://forums.unrealengine.com/u/theonecalledtom)\
**Post date:** [August 3, 2015, 2:45pm UTC](https://forums.unrealengine.com/t/why-does-one-of-my-declarations-produce-an-error-while-its-twin-works-fine/327456/21 "2015-08-03T14:45:20Z")

</div>

If you don’t need the implementation of the class inside the header files then forward declarations rather than #includes will keep your compile times down.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_71c55af3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_71c55af3](https://forums.unrealengine.com/u/anonymous_user_71c55af3)\
**Post date:** [August 3, 2015, 4:16pm UTC](https://forums.unrealengine.com/t/why-does-one-of-my-declarations-produce-an-error-while-its-twin-works-fine/327456/22 "2015-08-03T16:16:05Z")

</div>

I am not saying it always is. There are times where classes depend each other. When such a thing is needed forward declaration comes in as a solution.

Your game, your needs. I can never tell you what to do, nor i can know what is right. It is your choice.

[Previous page](https://forums.unrealengine.com/t/why-does-one-of-my-declarations-produce-an-error-while-its-twin-works-fine/327456.md?page=1)
