# Can't use enums in namespace

**URL:** <https://forums.unrealengine.com/t/cant-use-enums-in-namespace/591993>\
**Category:** C++\
**Tags:** UEnum, unreal-engine, UE5-0, question\
**Created:** [June 27, 2022, 9:52pm UTC](https://forums.unrealengine.com/t/cant-use-enums-in-namespace/591993 "2022-06-27T21:52:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ACBYTES](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ACBYTES](https://forums.unrealengine.com/u/ACBYTES)\
**Post date:** [June 27, 2022, 9:52pm UTC](https://forums.unrealengine.com/t/cant-use-enums-in-namespace/591993/1 "2022-06-27T21:52:59Z")

</div>

I have created the following `UENUM` in another header file and I’ve included it in my preferred header file to use it as a `UPROPERTY`. The problem is that when I place my enum in a namespace, I get `Cannot find class '', to resolve delegate 'ENUMTYPE'`. As soon as I have it out of the namespace, everything turns out to be fine. What could the problem be here?

```auto
namespace CAIAnimations
{
	UENUM(BlueprintType)
	enum class EMovementBSs : uint8
	{
		Default = 0,
		IdleTurning = 1
	};
}

```

And I use it in another class:

```auto
UPROPERTY(EditAnywhere)
CAIAnimations::EMovementBSs SomeName;

```

---

<div class="post-metadata">

**Author:** ![Chatouille](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/chatouille/32/1194622_2.png) [@Chatouille](https://forums.unrealengine.com/u/Chatouille)\
**Post date:** [June 28, 2022, 8:35am UTC](https://forums.unrealengine.com/t/cant-use-enums-in-namespace/591993/2 "2022-06-28T08:35:42Z")

</div>

You can, but you have to put the UENUM at namespace level.

However that is not recommended. See [guidelines here](https://docs.unrealengine.com/5.2/en-US/epic-cplusplus-coding-standard-for-unreal-engine/#strongly-typedenums).

---

<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:** [June 28, 2022, 1:27pm UTC](https://forums.unrealengine.com/t/cant-use-enums-in-namespace/591993/3 "2022-06-28T13:27:20Z")

</div>

Alternatively, you can do it but you can’t make it a UENUM (and ultimately not a UPROPERTY).

In general, namespaces are not supported in UE4/5 when also dealing with any of the engine reflection support. The one exception being the old style enumeration support where the only contents of the namespace is a specifically named enumeration. But that use case has (in general) been replaced by the use/support of `enum class` enumerations.
