Хочу реализовать отображение времени в QLabel. Описал класс:
class Clock : public QLabel
{
Q_OBJECT
public:
    Clock(QWidget* pwgt = 0) : QLabel(pwgt)
    {
        QTimer* ptimer = new QTimer(this);
        connect (ptimer, SIGNAL (timeout()) , SLOT (slotUpdateDateTime())) ;
        ptimer->start(500);
        slotUpdateDateTime();
    }
public slots:
void slotUpdateDateTime ()
    {
        QString str = QDateTime::currentDateTime().toString(Qt::SystemLocaleDate);
        setText("<H2><CENTER>" + str + "</CENTER></H2>");
    }
};
В main пишу:
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;
    Clock cl(&w);
    w.show();
    return a.exec();
}
Не хочет компилится. Пишет:
C:/Qt/pro/datetimer-build-desktop/debug/main.o:: In function `Clock':
C:\Qt\pro\datetimer-build-desktop/../datetimer/main.cpp:9: error: undefined reference to `vtable for Clock'
C:\Qt\pro\datetimer-build-desktop/../datetimer/main.cpp:9: error: undefined reference to `vtable for Clock'
C:/Qt/pro/datetimer-build-desktop/debug/main.o:: In function `~Clock':
C:\Qt\pro\datetimer-build-desktop/../datetimer/main.cpp:5: error: undefined reference to `vtable for Clock'
C:\Qt\pro\datetimer-build-desktop/../datetimer/main.cpp:5: error: undefined reference to `vtable for Clock'
:: error: collect2: ld returned 1 exit status
Наверное ему не нравится строка:
Так как же создать объект класса Clock и отобразить на Widget?