I am working on a program in Qt using c++. But i got stuck at this point because of this error. The weird thing is that i created a separate program in which the following code worked but when i put the code inside my program i get an error.
error: undefined reference to `vtable for Create_button_config'
The error is in the Header file in which i create the class. This is the part of the header file where the error occurs.
class Create_button_config : public QObject
{
Q_OBJECT
public:
QMap<QString, QString> buttons;
void setParameters(){
qDebug() << "test";
buttons["ID1"] = "#52B1";
buttons["ID2"] = "#52B2";
buttons["ID3"] = "#52B3";
}
};
And i use it in main.cpp like this
Create_button_config config;
config.setParameters();
Any ideas where this error comes from? And by the way is this the correct way to make an associative array which is available throughout my whole code?
Thanks in advance