Hello.
When I want to use the Q_OBJECT macro in one of my classes, I have link errors saying "unresolved external symbol" :
main.obj : error LNK2001: symbole externe non résolu "public: virtual struct QMetaObject const * __cdecl Recepteur::metaObject(void)const " (?metaObject@Recepteur@@UBAPBUQMetaObject@@XZ)
main.obj : error LNK2001: symbole externe non résolu "public: virtual void * __cdecl Recepteur::qt_metacast(char const *)" (?qt_metacast@Recepteur@@UAAPAXPBD@Z)
main.obj : error LNK2001: symbole externe non résolu "public: virtual int __cdecl Recepteur::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@Recepteur@@UAAHW4Call@QMetaObject@@H PAPAX@Z)
There's no error when I compile the same code without the Q_OBJECT macro.
Here's the code of my very simple class :
{
Q_OBJECT
public :
Recepteur(){};
public slots:
void ButtonPushedReceived()
{
printf("Le bouton a été poussé");
}
};
class Recepteur : public QObject
{
Q_OBJECT
public :
Recepteur(){};
public slots:
void ButtonPushedReceived()
{
printf("Le bouton a été poussé");
}
};
To copy to clipboard, switch view to plain text mode
Thank you for your answers.
Patrick Schevenels
Bookmarks