C++ enums not found

Hi, I’m trying to move from blueprint to c++. I’m not a c++ programmer and i’m struggling with making visible and usable my enums. Why if i create them that way, the solution can’t find my enums while i’m trying to use them in other classes? Thank you for your help!

I’ve already regenerated project file but nothing has changed

Hi. Did you type include the file/s with the enum definitions into AdditionalGeneralData.h? (the files that have the definition for EItemActorType,EEquipHandType & EInsspectorMeshType)

Hi thank you for your reply! Here i’ve included the enums with include pointing at the Folder. Isn’t that sufficent?

do i need to add “class EItemCategory” before the class declaration?

Perhaps the project is missing it’s .generated files. Try closing the project and regenerating it from the uproject file and see it that fixes up the yellow underlines in the includes.

I’ve already tried and deleted “Intermediate”, “Binaries” and “Saved” folder before running the “Generate project files” by clicking on the uproject file but yellow lines are still there. This is so tedious anyway, how can this be a serious workflow for a programmer… Never had to do those kind of tricks while working with java.

Wait, i’ve rewritten the variable type letting my ide to suggest the “include” and now seems working. Thank you for your patience! So i will need to always perform that ridicolous ritual of deleting folder when i create something by IDE and not by editor?

Unfortunately Unreal doesn’t work on pure c++ files. It relies on the .generated files to process macros and expose parts to blueprints. It also references the generated files inside of the intermediate folder inside of the project.

It’s an unfortunate pain.
You can add them in larger quantities and then do the regen.

Oh and you can forget about using namespaces to divide your code. Another bad design choice on the side of the Epic team :frowning:

1 Like

Thank you for your availability!