Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Link error with signal in Qt5
timain last edited by
I try to use signals and slots in my projects (with Qt5) and I have this link err :
_myWidget.obj:-1: erreur : LNK2019: symbole externe non résolu "public: void __cdecl DragWidgetCible::enableProcess(int)" (?enableProcess@MyWidget@@QEAAXH@Z) référencé dans la fonction "protected: virtual void _cdecl MyWidget::dropEvent(class QDropEvent *)" (?dropEvent@MyWidget@@MEAAXPEAVQDropEvent@@@Z)
I have this class
class MyWidget : public QFrame
And I use emit enableProcess(int) im my function *void MyWidget::dropEvent(QDropEvent event)
but the compiler says that my program cannot find the signals. ( I tried Q_OBJECTS but no result )
Thank you for help
[andreyc EDIT]: Added '@' around the code.
Xander84 last edited by
Hi, I don't see any mistake in the code you've provided, did you check the generated code and see if the signal is defined in there?
There should be file with the name moc_mywidget.cpp in your build folder.
Edit: wait your linker error is a little weird, it said "DragWidgetCible::enableProcess(int)", where is that class DragWidgetCible coming from I thought you have defined the signal in MyWidget?