Help using UUserDefinedEnum

Hi Everyone!

I started learning UE4 and I’m following this tutorial where they made an Enumeration as a blueprint.
I want to replicate that but using c++. I looked around and found the UUserDefinedEnum, but I don’t exactly find an implementation of it to follow as a guide. I see a lot of methods that I have to override but some of the parameters I don’t even know what i’ll be sending.

I tried an Example on this forum but its not compiling to me. I’m copying and pasting the enumeration section but it throws an error on the compiler; I think it has to be with the UE version, maybe I have to add something else to make it work on 4.9.

If you know of any other way to achieve that using C++, I’m open for suggestions.

Thank you for your time and help!

The simplest enum definition can look like this, placed in MyEnumType.h should compile fine

#pragma once

#include "MyEnumType.generated.h"

UENUM(BlueprintType)
enum class EMyEnumType : uint8
{
	ET_None     UMETA(DisplayName = "None"),
	ET_One   UMETA(DisplayName = "One"),
	ET_Two      UMETA(DisplayName = "Two"),
	ET_Three      UMETA(DisplayName = "Three"),
	ET_four    UMETA(DisplayName = "Four")
};

All includes and directives a vital. UE will not compile without .generated.h file inclusion. And macros are used for UE reflection system. What is your compiler error?

Then i don’t know if i’m not following the right steps.
I tried adding a header file to my folder and pasting the code above.
And including it in the same class as my character (the one the engine generate) and still got erros.

Here’s an image with the erros. http://prntscr.com/8pn759