Cyclic dependency on header files

#Wiki For You

I polished and updated my Wiki on Forward Declaration, just forward declare your character class in your inventory class

#Solution For You in Exact Detail

include your inventory class at the top of your character class

then you should #include your character class only in the .cpp file of your inventory class, avoid trying to access your character class in your inventory .h, You use forward declaration to include a pointer to your character class in your inventory .h, but you dont access its vars in the .h, only in the .cpp


inventory class .h → forward declares character class (see wiki)

inventory class. cpp → now you can #include character class and actually access its functions and vars

character class .h#include your inventory class, use inventory however you like in .h or .cpp

#Wiki Link

UE4 Forward Declaration


PS: dont mess with the UE4 auto-generated classes files, just do the above, you should make edits only to inventory and character classes at your project level.