Error : Missing '{' in 'Enum'

Hi.

I have an enum to expose for use in other modules.
I use UE 4.27 with C++. (no blueprint)
My code is as follows:

UENUM()
enum class CIVILCOMPUTER_API EParallelDeviationQuality : uint8 {
	GOOD,
	POOR,
	FAIL,
};

I am getting error : Missing '{' in 'Enum' at compilation.
Where am I going wrong?

Kindly, help me, please.
Thank you, in advance.

1 Like

The last element in an ENUM list should not have a comma.

That is not the problem, it is perfectly fine to end it with a comma.

More likely that either GOOD POOR or FAIL is defined somewhere else as something else.
enum entries should be using Pascal case and not all caps which is reserved for Macros and constants.

You should also delete CIVILCOMPUTER_API.

Remove CIVILCOMPUTER_API

Enumerations don’t/can’t be tagged for DLL export. You can use them in other modules without that macro anyway.

2 Likes

Also, requires removal of UENUM() at the top.

Why? it should work with UENUM()

That is just plain wrong though,

Also, requires removal of UENUM() at the top. ? :thinking:

Its likely you never had a generated.h specified when you used reflection. But your solution is not valid and this will cause confusion to people in the future.