I have a few cpp files and headers to them. The problem is when i try do something like this:
character.cpp
#include "item.h"
class Character {
public:
// variables such as health etc //
void equip(Item *i){
equipment.push_back(i);
this->attc += i->attc;
this->health += i->health;
this->luck += i->luck;
this->mana += i->mana;
i->equipped = true;
}
};
character.h
class Character;
item.h
class Item;
item.cpp
#include "item.h"
class Item {
public:
bool equipped;
string desc;
int attc;
int health;
int mana;
bool twoHanded;
int luck;
};
Expected to work, but instead gets:
pointer to incomplete class type is not allowed
… in i->something
line.
I don't really know why it's not working :c