# Class declaration into a header?

**URL:** <https://forums.unrealengine.com/t/class-declaration-into-a-header/417175>\
**Category:** Community & Industry Discussion\
**Tags:** include, header, Class, unreal-engine, question\
**Created:** [February 13, 2018, 10:13am UTC](https://forums.unrealengine.com/t/class-declaration-into-a-header/417175 "2018-02-13T10:13:10Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [February 13, 2018, 1:20pm UTC](https://forums.unrealengine.com/t/class-declaration-into-a-header/417175/3 "2018-02-13T13:20:23Z")

</div>

This is called forward declaration, you declare incomplete class for type to work in header file, later it is properly declared in different include in cpp file (note that true function of #include is pasting content of the file to another file and fact that header files alone are never compiled on there own they are used in compilation of cpp files) if type is really used in cpp file, otherwise you will get use of incomplete type error. This is to avoid circular dependency in header files which may cause issues, if possible you should avoid including header file other then one containing base class of class you declaring, and forward declaration is one of methods to avoid that.

You can read about it here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — https://unrealcommunity.wiki/! You will be able to find content from...

---

_[View the full topic](https://forums.unrealengine.com/t/class-declaration-into-a-header/417175)._
