[Qt-interest] unresolved Symbol (QMetaObject const QwtPlot::staticMetaObject) in qwtplot derived Class

Matthias Pospiech matthias.pospiech at gmx.de
Thu Dec 11 12:41:46 CET 2008


I have the following class which is derived from QwtPlot (which is 
derived from QFrame)
It includes  Q_OBJECT, a moc file is created and part of the project, 
but I get this linker error:

1>moc_QScatterPlot.obj : error LNK2001: Nicht aufgelöstes externes 
Symbol ""public: static struct QMetaObject const 
QwtPlot::staticMetaObject" (?staticMetaObject at QwtPlot@@2UQMetaObject@@B)".

Why, and how do I resolve it?

#ifndef QSCATTERPLOT_H_
#define QSCATTERPLOT_H_

#include <QtGui/QWidget>

#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_grid.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_layout.h>
#include <qwt_symbol.h>

class QScatterPlot : public QwtPlot
{
    Q_OBJECT
public:
    QScatterPlot(QWidget* parent = 0);
    virtual ~QScatterPlot();

    void initWidget();
    void setSymbol(QwtSymbol::Style symbol, QColor c, QSize size);
    void setData(const double * xData, const double * yData, int size);
    void setData(const double * xData, const double * yData, int start, 
int size);


public:
    QwtPlotCurve * Curve;

private:
    struct structDataXY{
        double * x;
        double * y;
    };
    structDataXY m_data;

};
#endif



More information about the Qt-interest-old mailing list