PDA

View Full Version : Link error in TV plot example



fantom
10th March 2011, 16:29
Hello all,

I compiled the tvplot example and i am getting the following error:

error LNK2001: unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject" (?staticMetaObject@QwtPlot@@2UQMetaObject@@B)

Do you have any idea?

Added after 46 minutes:

I already found the problem.That's because QwtPlot doesn't inherit QObject.

Uwe
11th March 2011, 09:56
No - QwtPlot inherits QWidget what inherits QObject.

The error message is an indication, that the generated moc file has not been compiled and linked against your application. Usually this happens, when you add the Q_OBJECT macro to a class and forget to run qmake to build the rules for the moc files into the makefile.

Uwe