The problem almost certainly is that you are not compiling or linking the moc_AddressBook.cpp file to the generated file. (It should have been generated for you - you run Qt moc in your code before compiling, right?)
To answer in a little more detail, the Q_OBJECT macro displays the Qt moc tool to create an additional implementation file that contains the code needed to support the QObject meta-information system. If you had any signals or slots, this would also do something for them.
An alternative solution would be to delete the Q_OBJECT macro. You probably don't want to do this, but it will help the immediate problem, and it is not strictly necessary for the code that you presented.
In addition, I would like to note that your line:
#include "addressbook.h"
Must be:
#include "addressbook.h"
based on how you provided the file names in the question.
Caleb Huitt - cjhuitt Oct 12 '09 at 0:53 2009-10-12 00:53
source share