# generated.h already included, missing '#pragma once'

**URL:** <https://forums.unrealengine.com/t/generated-h-already-included-missing-pragma-once/2746576>\
**Category:** C++\
**Tags:** unreal-engine, question\
**Created:** [August 26, 2026, 9:16am UTC](https://forums.unrealengine.com/t/generated-h-already-included-missing-pragma-once/2746576 "2026-08-26T09:16:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pastelfable](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pastelfable/32/1138306_2.png) [@pastelfable](https://forums.unrealengine.com/u/pastelfable)\
**Post date:** [August 26, 2026, 9:16am UTC](https://forums.unrealengine.com/t/generated-h-already-included-missing-pragma-once/2746576/1 "2026-08-26T09:16:54Z")

</div>

When trying to compile my code I get the error:

0\>MassEnemy.generated.h(10,1): Error C1189 : #error: “MassEnemy.generated.h already included, missing ‘#pragma once’ in MassEnemy.h”

But #pragma once is there. I know this error can be caused by a bad #include, but I’ve checked the includes and there’s no unused ones or reoccurring ones. Is there anything else that can cause this error?

---

<div class="post-metadata">

**Author:** ![MagForceSeven](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/magforceseven/32/906563_2.png) [@MagForceSeven](https://forums.unrealengine.com/u/MagForceSeven)\
**Post date:** [August 26, 2026, 11:49am UTC](https://forums.unrealengine.com/t/generated-h-already-included-missing-pragma-once/2746576/2 "2026-08-26T11:49:49Z")

</div>

If you disable the Unity build through your module’s build.cs, you can narrow down to what cpp is being compiled. That might help narrow things down.

You could also search for “MassEnemy.generated.h” in case you’ve accidentally included it somewhere else by mistake.

That’s about as much as I can help without seeing any of the code or the full error text.

---

<div class="post-metadata">

**Author:** ![pastelfable](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pastelfable/32/1138306_2.png) [@pastelfable](https://forums.unrealengine.com/u/pastelfable)\
**Post date:** [August 27, 2026, 11:13pm UTC](https://forums.unrealengine.com/t/generated-h-already-included-missing-pragma-once/2746576/3 "2026-08-27T23:13:59Z")

</div>

Turns out I did have MassEnemy.generated.h included somewhere else! Thank you for your help!
