PDA

View Full Version : Error when qsing qwt in qt application



marc2050
29th July 2011, 05:29
Hi.

I had programmed a qt application. Everything runs fine.
I like to add in some plotting function and found this wonderful qwt.
So, I am now trying to integrate qwt into my qt application.
But I got the following error.

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

In my .pro file, I've already done the
QWT_ROOT = "c:\mydirectory\qwt-6.0"
LIBS += -lmyspeciallibrary -lqwt -lqwtmathml
LIBPATH += $${QWT_ROOT}/lib
INCLUDEPATH += $${QWT_ROOT}/src
qtAddLibrary(qwt)

So, I dont know what else I am missing. Any help please?
Thank you!!

Uwe
29th July 2011, 06:47
Use the features file of Qwt - read the instructions in INSTALL how to do it.

Uwe

marc2050
29th July 2011, 16:27
Thanks.
I read the INSTALL file and added the CONFIG += qwt.
My error is still the same.
Below is my .pro file.
I really have no clue how to solve it. Any more help please.






QT += core gui
QWT_ROOT = "c:/mydirectory/qwt-6.0"

TARGET = myprogram
TEMPLATE = app


SOURCES += main.cpp\
mainwindow.cpp \
andmorewhateverfilesIneed.cpp

HEADERS += mainwindow.h \
andmorewhateverfilesIneed.h


DEFINES += QWT_DL
CONFIG += qwt
QMAKE_LIBDIR += $${QWT_ROOT}/lib
INCLUDEPATH += $${QWT_ROOT}/src
LIBS += -lqwt
qtAddLibrary(qwt)
FORMS += mainwindow.ui

Uwe
29th July 2011, 16:33
Remove all lines you have added ( beside CONFIG += qwt ).

Uwe

PS: it's QWT_DLL not QWT_DL, but this define should be set by the qwt features file if you have configured qmake successfully

marc2050
30th July 2011, 01:06
I did what exactly what is said. removed the lines etc.
Problem persists. :(
Is there someone who can give the exact meaning to the error of
unresolved external symbol "public: static struct QMetaObject const QwtPlot::staticMetaObject"

It seems to me that my codes



#include <qwt_plot.h>
#include <qwt_plot_spectrogram.h>

class myMap: public QwtPlot
{
Q_OBJECT

public:
myMap(QWidget * = NULL);

public Q_SLOTS:
// void showContour(bool on);
// void showSpectrogram(bool on);

private:
QwtPlotSpectrogram *d_spectrogram;
};



the part "public QwtPlot" is the source of error?