[Qt-interest] undefined reference to `vtable for StringListModel'

phil prentice philp.cheer at talktalk.net
Mon Mar 16 15:15:03 CET 2009


Hi Tony
  yes that was my problem.
  Thank you very much for your help

Phil


On Monday 16 March 2009 13:30, Tony Rietwyk wrote:
> Phil wrote:
> > Hi
> >   Sorry if this is more of a C++ question then QT.  I was
> > going through a QT
> > Help example and was trying to build it but get the error message:-
> >
> > main.o(.gnu.linkonce.t._ZN15StringListModelC1ERK11QStringListP
> > 7QObject[StringListModel::StringListModel(QStringList
> > const&, QObject*)]+0x1a): In function
> > `StringListModel::StringListModel(QStringList const&, QObject*)':
> > /home/philp/MODEL_VIEW/QAbstractListModelExample/stringListModel.h:7:
> > undefined reference to `vtable for StringListModel'
>
> sniped code
>
> > I am trying to learn as much as I can about C++ & QT but I
> > dont find this
> > error message very helpful...can anybody explain what I am
> > doing wrong.
> >
> > Thanks for your help
> >
> > Phil
>
> Hi Phil,
>
> I think this means that the header file is not being processed by moc -
> make sure you have added the header file in your .pro:
>
> HEADERS += stringListModel.h
>
> After running qmake, you should see that a file moc_stringListModel.cpp is
> generated and is being compiled and linked.
>
> Hope that helps,
>
> Tony.
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list