Results 1 to 8 of 8

Thread: Errors

  1. #1
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Errors

    I couldnt solve this problems.I added Q_OBJECT.But I again got these...
    programeditor.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall ProgramEditor::metaObject(void)const " (?metaObject@ProgramEditor@@UBEPBUQMetaObject@@XZ)
    programeditor.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall ProgramEditor::qt_metacast(char const *)" (?qt_metacast@ProgramEditor@@UAEPAXPBD@Z)
    programeditor.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall ProgramEditor::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@ProgramEditor@@UAEHW4Call@QMetaObjec t@@HPAPAX@Z)
    programeditor.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall ProgramEditor::MyShow(void)" (?MyShow@ProgramEditor@@MAEXXZ)
    programeditor.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall ProgramEditor::MyHide(void)" (?MyHide@ProgramEditor@@MAEXXZ)
    programeditor.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const ProgramEditor::staticMetaObject" (?staticMetaObject@ProgramEditor@@2UQMetaObject@@B )

  2. #2
    Join Date
    Oct 2007
    Location
    Munich, Bavaria
    Posts
    144
    Thanks
    1
    Thanked 19 Times in 19 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    The moc generated files are missing.
    Please use qmake to create your project.

    http://doc.trolltech.com/4.3/qmake-manual.html

  3. #3
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    I know.That is not my first project.
    I created project again and again.I controlled error:I think problem is that:
    My programEditor.h programList.h .... include Q_OBJECT.Afted qmake I can create moc files for all except programEditor.h.So above problems occur.
    That is programEditor.h

    Qt Code:
    1. #ifndef PROGRAMEDITOR_H
    2. #define PROGRAMEDITOR_H
    3.  
    4. #include "abstractClass.h"
    5. #include "Program.h"
    6. #include "ProgramList.h"
    7. #include "MyStyle.h"
    8.  
    9. #include <QKeyEvent>
    10. #include <QString>
    11. #include <QShowEvent>
    12. #include <QMenu>
    13. #include <QAction>
    14. #include <QListWidgetItem>
    15. #include <QCloseEvent>
    16.  
    17. #include "ui_programEditor.h"
    18. #include "ui_listDialog.h"
    19. #include "ui_commandEditor.h"
    20. #include "ui_setPoints.h"
    21.  
    22. #define PARALLEL "parallel"
    23. #define MAIN "main"
    24.  
    25. using namespace Ui;
    26.  
    27. class ProgramEditor :public AbstractClass
    28. {
    29. Q_OBJECT
    30. public:
    31. ProgramEditor(QWidget *parent=0);
    32. ~ProgramEditor();
    33. void Show();
    34.  
    35. private:
    36. int programIndex;
    37. ProgramList *programlist;
    38. Program myProgram;
    39. QVector<QTreeWidgetItem *> treeItem;
    40. QVector<QTreeWidgetItem *> treeSubItem;
    41. QVector<QListWidgetItem *> groupItem;
    42. QVector<QListWidgetItem *> commandItems;
    43.  
    44. QMenu *menu;
    45. QAction *changeSetPoint;
    46. MyStyle *mystyle;
    47.  
    48. void ProgramDialog();
    49. void ShowProgramList();
    50. void DeleteProgramList();
    51. void CreateProgramEditor();
    52. void CreateTreeWidget();
    53. void CreatePointMenu(int indexOfStep ,int indexOfComm);
    54. void TreeWidgetFocus();
    55. void CreateMenus();
    56. void CreateCommandEditor(QDialog *dialog);
    57. void CreateSetPointEditor(QDialog *dialog);
    58. void DeleteDialog();
    59. void CloseInputWidget();
    60.  
    61. UIProgramEditor *UIeditor;
    62. UIListDialog *UIprogramDialog;
    63. UICommandEditor *UIcommandEditor;
    64. UISetPoint *UIsetPoint;
    65.  
    66. //SetPoint Menu kısmı
    67.  
    68. QStringList CommandList;
    69.  
    70. protected:
    71. void keyPressEvent(QKeyEvent *event);
    72. void showEvent(QShowEvent *event);
    73. //void closeEvent(QCloseEvent *event);
    74.  
    75. bool event(QEvent *e);
    76.  
    77. public slots:
    78. void GetIndex(int index);
    79. void TreeWidgetItemChanged(QTreeWidgetItem *,QTreeWidgetItem *);
    80. void ShowCommandEditor();
    81. int ShowSetPointEditor();
    82. signals:
    83. void MyShow();
    84. void MyHide();
    85.  
    86. };
    87.  
    88. #endif
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 23rd November 2007 at 12:24. Reason: missing [code] tags

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    Does AbstractClass inherit QObject?

  5. #5
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    #ifndef ABSTRACTCLASS_H_
    #define ABSTRACTCLASS_H_

    #include <QWidget>

    class AbstractClass : public QWidget
    {
    public:
    AbstractClass(QWidget *parent)
    :QWidget(parent){}
    virtual void Show()=0;
    };
    #endif

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    Is programEditor.h listed in HEADERS variable in your .pro file?

  7. #7
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    yes.It is listed.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Errors

    Do you have only one .pro file? Do you SUBDIRS template?

Similar Threads

  1. Ui class errors
    By calef13 in forum Qt Programming
    Replies: 2
    Last Post: 4th November 2007, 13:53
  2. why i am getting errors:: undefined reference to
    By arunchaudhary1983 in forum Newbie
    Replies: 5
    Last Post: 22nd October 2007, 10:33
  3. Qt Compile Errors?
    By magikalpnoi in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2006, 22:18
  4. Qt 4.1.0 - static examples run with errors!
    By Elder Orb in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2006, 09:40

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.