Author Topic: Fails to compile due to "undefined reference"  (Read 1971 times)


  • Guest
Fails to compile due to "undefined reference"
« on: November 26, 2008, 01:49:27 am »
I am new to Code Blocks.  I have been working with Qt 4 (4.4.3), studying the examples in the book C++ GUI Programming with Qt 4. I am able to successfully compile and run examples using standard method of "qmake -project, qmake *.pro, make" without any problems.  I am using GNU GCC compiler.

When I build the same files in Code Blocks by copying exact duplicates of code from the book, I get these types of errors:  "undefined reference to 'FindDialog::FindDialog(QWidget*)" on the following line of code "FindDialog *dialog = new FindDialog;"  I am working in Windows XP and I have installed QtWorkBench plugin.

Same error occurs when I compile other programs with similar code lines.

Any help on what I need to do to correct this error would be appreciated.  Thank you in advance.
« Last Edit: November 26, 2008, 02:21:00 am by feacode »