I've searched the web for this and found the similar problem a bunch but I can't quite get it fixed with my code following all that information. I'm a total beginner.
I'm getting an undefined reference to vtable for Character error
. Code below.
Character.h:
#ifndef CHARACTER_H_
#define CHARACTER_H_
#include "ZorkUL.h"
#include <QObject>
#include <string>
using namespace std;
#include <vector>
using std::vector;
class Character : public QObject {
Q_OBJECT
private:
int health;
int stamina;
public:
Character();
void setHealth(void);
void setStamina(void);
signals:
void listener();
};
#endif /*CHARACTER_H_*/
Character.cpp:
#include "Character.h"
Character::Character() {
this->health = 100;
this->stamina = 100;
}
void Character::setHealth(void){
this->health = health - 10;
}
void Character::setStamina(void){
this->stamina = stamina - 10;
}
void Character::listener(){
}