Hi,
I had the same problem on 4.22 Unreal version.
The error: “Expected the name of a previously defined enum” isn’t caused by a missing include file because it is not a C++ compiler error but it is an Epic HeaderTool error.
Basically if you define a UENUM in a Header file without define any USTRUCT or UCLASS the HeaderTool doesn’t parse that file, so the UENUM definition will not be stored in the object hash list.
Possible solutions (until Epic GenerateProjectFiles fix)
-
Move the UENUM declaration in a Header file where there are some USTRUCT or UCLASS declaration
-
Declare a dummy struct or class like this:
USTRUCT()
struct FDummyStruct
{
GENERATED_BODY()
};
and launch the batch GenerateProjectFiles.bat so the HeaderTool will parse your header.
Regards.