In RPGPowerBase.cpp (where I tried to use component), actually solved it. Though I must admit it boggles my head now, how it could possibly solve problem, since I don’t even try to access directly to it ?
From this example it looks like you are directly accessing it.
If you passed the EquipmentManager pointer around with out accessing MainWeapon it might work without including the EquipmentManager header.
This is because the class using EquipmentManager needs to know the full declaration of EquipmentManager before it can access any properties of that class.
You are right. I’m directly accessing it. bad wording on my part.
My confusion is here because this worked before, and after migrating to new version of UE4 it didn’t even compile.
I’m not sure but it must be something new to VS2013, as I used 2012 before and didn’t needed to provide header files if I wanted to access properties of other classes.
I can only assume that somewhere somehow the header file was included in PowerOwner for your 2012 project in order for it to have worked.
Maybe you added the include inside of the PowerOwner header? or maybe it was added to a precompiled header file?
Either way, it’s best practice to always include the header file because this will tell you, and any other programmer, that this class depends on the EquipmentManager to perform its functions.