# Cannot find header file inside subfolder

**URL:** <https://forums.unrealengine.com/t/cannot-find-header-file-inside-subfolder/2875675>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [December 1, 2026, 7:22pm UTC](https://forums.unrealengine.com/t/cannot-find-header-file-inside-subfolder/2875675 "2026-12-01T19:22:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ViaCognita](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/viacognita/32/906601_2.png) [@ViaCognita](https://forums.unrealengine.com/u/ViaCognita)\
**Post date:** [December 1, 2026, 7:22pm UTC](https://forums.unrealengine.com/t/cannot-find-header-file-inside-subfolder/2875675/1 "2026-12-01T19:22:22Z")

</div>

Hi!

I have added a class and its header file in the same folder: `MyGame\Source\MyGame\Core`. But when I try to compile it I get the error:

`C:\MyGame\Source\MyGame\Core\MyGameModeBase.cpp(4, 1): fatal error C1083: Cannot open include file: 'Core/MyGameModeBase.h': No such file or directory.`

How can I fix it?

Thanks!

---

<div class="post-metadata">

**Author:** ![Vahab](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/vahab/32/1148756_2.png) [@Vahab](https://forums.unrealengine.com/u/Vahab)\
**Post date:** [December 1, 2026, 10:51pm UTC](https://forums.unrealengine.com/t/cannot-find-header-file-inside-subfolder/2875675/2 "2026-12-01T22:51:50Z")

</div>

> [@ViaCognita](#):
>
> I have added a class and its header file in the same folder: `MyGame\Source\MyGame\Core`. But when I try to compile it I get the error:
> 
> `C:\MyGame\Source\MyGame\Core\MyGameModeBase.cpp(4, 1): fatal error C1083: Cannot open include file: 'Core/MyGameModeBase.h': No such file or directory.`
> 
> How can I fix it?

Because MyGameModeBase.cpp and MyGameModeBase.h are in the exact same folder (Core), change the include statement to

`#include "MyGameModeBase.h"`
