Results 1 to 4 of 4

Thread: Linking problem

  1. #1
    Join Date
    Feb 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Question Linking problem

    Hello everyone, I´m getting a LNK2019 unresolved external symbol with a dialog I created in QtDesigner and I can´t seem to be able to find the reason. I´m using VS 2005 with the integration set.

    The dialog is called sizeofmapdialog.

    I have this in mainwindow.cpp:

    Qt Code:
    1. #include <QtGui>
    2. #include <QGraphicsEllipseItem>
    3. #include <QPointF>
    4. #include <QImage>
    5.  
    6. #include "mainwindow.h"
    7. #include "view.h"
    8. #include "chip.h"
    9. #include "sizeofmapdialog.h"
    To copy to clipboard, switch view to plain text mode 

    This in mainwindow.h:

    Qt Code:
    1. class SizeOfMapDialog;
    2.  
    3. class MainWindow : public QMainWindow
    4. {
    5. Q_OBJECT
    6. public:
    7. MainWindow();
    8.  
    9.  
    10. private slots:
    11. void open();
    12. void about();
    13. void SizeOfMap();
    14.  
    15. private:
    16. ...
    17. SizeOfMapDialog *dialog;
    To copy to clipboard, switch view to plain text mode 

    I have also checked the .pro file to see if the moc has included the files related to the dialog:

    TEMPLATE = app
    TARGET =
    DEPENDPATH += . debug
    INCLUDEPATH += .
    QT += opengl

    # Input
    HEADERS += chip.h mainwindow.h sizeofmapdialog.h view.h
    FORMS += sizeofmapdialog.ui
    SOURCES += chip.cpp main.cpp mainwindow.cpp sizeofmapdialog.cpp view.cpp
    RESOURCES += images.qrc

    Where else can it be the linking problem with sizeofmapdialog?

    Thanks in advance and regards.
    Last edited by wysota; 1st March 2007 at 20:34. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Linking problem

    The relevant code is missing but here comes my wild guess : is the Q_OBJECT macro present in SizeOfMapDialog declaration???
    Current Qt projects : QCodeEdit, RotiDeCode

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Linking problem

    Could you post the exact error?
    J-P Nurmi

  4. #4
    Join Date
    Feb 2007
    Posts
    15
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Linking problem

    I was finally able to solve the problem. I was finally able to find a missing declaration in a mainwindow.h (actually it was in a wrong place). Thanks to jpn for his hint, I´ve seen in the forums that it´s quite usual to forget the Q_OBJECT macro, but it wasn´t this case.

    Regards.

Similar Threads

  1. Permission denied error during linking
    By bashamehboob in forum Newbie
    Replies: 2
    Last Post: 15th April 2006, 13:02
  2. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. Replies: 4
    Last Post: 20th February 2006, 09:11
  5. Runtime dynamic linking + Qt4 problem
    By _Ramirez_ in forum Qt Programming
    Replies: 5
    Last Post: 11th February 2006, 14:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.