Hi,

I'm completely new to QT and I'm trying to enter an example from the book "C++ GUI Programming with QT 4". I'm using Codeblocks as IDE. However I receive the following error :

obj\Debug\main.o||In function `main'
C:\Qt_Projects\FindDialog\main.cpp|12|undefined reference to `FindDialog::FindDialog(QWidget*)'|
||=== Build finished: 1 errors, 0 warnings ===|

I'm already looking hours at the syntax, but I can't see anything wrong.

Here is the contents of the header file :

Qt Code:
  1. #ifndef FINDDIALOG_H
  2. #define FINDDIALOG_H
  3.  
  4. #include <QDialog>
  5.  
  6. class QCheckBox;
  7. class QLabel;
  8. class QLineEdit;
  9.  
  10. class FindDialog : public QDialog
  11. {
  12. Q_OBJECT
  13.  
  14. public:
  15. FindDialog(QWidget *parent = 0);
  16.  
  17. signals:
  18. void findNext(const QString &str, Qt::CaseSensitivity cs);
  19. void findPrevious(const QString &str, Qt::CaseSensitivity cs);
  20.  
  21. private slots:
  22. void findClicked();
  23. void enableFindButton(const QString &text);
  24.  
  25. private:
  26. QLabel *label;
  27. QLineEdit *lineEdit;
  28. QCheckBox *caseCheckBox;
  29. QCheckBox *backwardCheckBox;
  30. QPushButton *findButton;
  31. QPushButton *closeButton;
  32. };
  33.  
  34. #endif // FINDDIALOG_H
  35.  
  36. The first lines of the class definition of the .cpp file :
  37.  
  38. FindDialog::FindDialog(QWidget *parent)
  39. : QDialog(parent)
  40. {
  41. ......
  42. }
  43.  
  44. and the main file :
  45.  
  46. #include <QApplication>
  47.  
  48. #include "finddialog.h"
  49.  
  50. int main(int argc, char* argv[])
  51. {
  52. QApplication app(argc, argv);
  53.  
  54. FindDialog *dialog = new FindDialog; <<<<<<-- Error here
  55. dialog->show();
  56.  
  57. return app.exec();
  58. }
To copy to clipboard, switch view to plain text mode 

Any help is much appreciated,
Thanks a lot !!
Nico