Unreal Engine 5 project fails when adding an enum variable

I am trying to create a project in Unreal Engine 5.8.2. I have created an enum in C++ in its own header file:

enum class MATHGENIE_API EOperations
{
	Addition,
	Subtraction,
	Multiplication,
	Division
};

In the header file of another class I try to add a variable of this enum:

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
	EOperations Operations;

The Intellisense seems happy, but these two lines cause errors to appear when I rebuild and then my UE project is broken and I cannot recover it.

Some of the errors in the IDE is:

Severity Code Description Project File Line Suppression State Details
Error (active) E0842 template parameter “T” is not used in or cannot be deduced from the template argument list of class template “UEStaticAssertCompleteType_Private::TUEStaticAssertTypeCheckerBase<>” MathGenie D:\Program Files\Epic Games\UE_5.8\Engine\Source\Runtime\Core\Public\Misc\StaticAssertCompleteType.h 34

From those snippets, you’re missing the UENUM macro before the enumeration.

That’s necessary to create the reflection and some of the auto generated code that allows it to be used as a UPROPERTY.

Also for blueprint compatibility you’ll need to give it a uint8 size:

UENUM( )
enum class EOperations : uint8
   ...

Enums don’t need the _API macro.

Style suggestion: Generally enums are specified in the singular, so EOperation not EOperations. This makes the scoping read more intuitively when you do EOperation::Addition in code. Or even for variables since the variable can only hold a single value at a time.