I have this enum in Item class
enum EquipSlot
{
RightHand,
Head,
...
};
character class has this function declaration
void Character::UnequipSlot(Item::EquipSlot slot);
item class is not in any namespace or a part of another class.
i use Item::EquipSlot in implementation a lot with no error. it only gives compile error while in declaration.
What’s the correct way to call enum of another class?
(compiler is vc++ 9)
error is : error C2027: use of undefined type ‘Item’ (item class is used in other declarations)
thanks.
Include the header that defines
Item.If
Itemis only declared,Itemmay be used in some contexts, but not when the size or contents ofItemare required.