I'm practicing with QT for one of my classes, and I keep getting Undefined reference to vtable for class
despite no virtual function. I've looked around for a solution but it seems like they all had at least one function that is declared as virtual. Here is the code:
class C : public QObject
{
Q_OBJECT
public:
C(int value) { value_ = 0; }
int getValue() const { return value_; }
public slots:
void setValue(int value){
if (value != value_) {
value_ = value;
emit valueChanged(value);
}
}
signals:
void valueChanged(int newValue){}
private:
int value_;
};
I have no idea what's going on. I've tried changing the function names just in case they have the same name as some functions in the base class but it didn't solve anything. Here's the error:
/*path of file*/
error : undefined reference to `vtable for C'
Thanks