How to Make C++ ENUMS Instance Editable in blueprint?

Hi.

I actually have an ENUM in a header file.
I’ve Included the header file in c++ file of the required.
Now I want to Expose the ENUM in the blueprint based on the c++ file, but when I use UPROPERTY macro it it throwing many errors.

The ENUM header
image

Variable
image

Error

> [2/4] Compile BoardSquare.gen.cpp
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Source\ChessCPP\Public\Board\BoardSquare.h(82): error C3646: 'ColorEN': unknown override specifier
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Source\ChessCPP\Public\Board\BoardSquare.h(82): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Intermediate\Build\Win64\UnrealEditor\Inc\ChessCPP\BoardSquare.gen.cpp(1204): error C2039: 'ColorEN': is not a member of 'ABoardSquare'
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Source\ChessCPP\Public\Board\BoardSquare.h(13): note: see declaration of 'ABoardSquare'
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Intermediate\Build\Win64\UnrealEditor\Inc\ChessCPP\BoardSquare.gen.cpp(1204): error C2618: illegal member designator in offsetof
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Intermediate\Build\Win64\UnrealEditor\Inc\ChessCPP\BoardSquare.gen.cpp(1204): note: offsetof has a builtin meaning; use /Zc:offsetof- to revert to old, non-conforming definition
>   [3/4] Compile CPP_Player.cpp
>   [4/4] Compile BoardSquare.cpp
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Source\ChessCPP\Public\Board\BoardSquare.h(82): error C3646: 'ColorEN': unknown override specifier
>   C:\Users\Owaiz\Documents\Unreal Projects\ChessCPP\Source\ChessCPP\Public\Board\BoardSquare.h(82): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
> Build failed.

Please Help Me out

Are you including the enum header inside of your actor where you are declaring the property?

If you made the header file with the enum by hand then check if it’s in the source folder. VS sometimes puts fresh files in the intermediate folder for some reason.
Make sure the enum header file is visible in your solution explorer in the project.

From the error it also seems to point to a variable called offsetof that is already a built in reserved work. Try changing the your variable name if it is present.

The structure of the enum itself works fine. Tried it in a test project and everything compiles no problems. Try checking your includes.

Thanks, It worked after including the ENUM Header in the Header file instead of cpp file