Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Link error with signal in Qt5
Forum Update on Monday, May 27th 2025

Link error with signal in Qt5

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 753 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    timain
    wrote on 5 May 2014, 13:14 last edited by
    #1

    Hello,
    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)
    @

    In fact,
    I have this class
    @
    class MyWidget : public QFrame
    {
    protected:
    ....
    public:
    ...
    signals:
    void enableProcess(int);

    private slots:
    ...
    };
    @
    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.

    1 Reply Last reply
    0
    • X Offline
      X Offline
      Xander84
      wrote on 5 May 2014, 13:58 last edited by
      #2

      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?

      1 Reply Last reply
      0

      1/2

      5 May 2014, 13:14

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved