PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : probleme mit qwt



SWE_laie
03-01-2005, 19:35
Hallo
ich hoffe ihr könnt mir helfen. Ich habe das Problem das ich die Beispiel bei qwt nicht neu kompilieren kann. Ich habe die Qwt Version 4.2.0 und mein Qt Version ist 3.3.3 Education. Für das Kompilieren nutze ich die vorgegebene .pro Datei. Da ich qwt für eine Hausarbeit nutzen will, wäre es schön, wenn mir dabei einer helfen könnte. :confused:

ps.: mein Benutzername ist programm!! zumindest bei qt und qwt.

lumbar
04-01-2005, 17:02
Hallo
Ich habe das Problem das ich die Beispiel bei qwt nicht neu kompilieren kann. Ich habe die Qwt Version 4.2.0 und mein Qt Version ist 3.3.3 Education. Für das Kompilieren nutze ich die vorgegebene .pro Datei.

Sagst du uns auch, was dein Problem ist? Irgendwas auf der Konsole wird den Fehler benennen, paste das hier.

Windows oder Linux?
Welcher Kompiler?

Lumbar

SWE_laie
05-01-2005, 18:36
Mein Betriebssystem ist Windows 2000 und als Kompiler verwende ich
"Microsoft Visual Studio.NET 2003".

Also mein Problem ist:
Das kompilieren klappt nicht, wenn ich die Beispieldatei "simple.cpp" mit einer selbst erstellten .pro Datei bekomme ich lauter LNK Fehler. Die ganzen Include-Dateien habe ich in den gleichen Ordner wie die simple.cpp Datei gespeichert. Ich weis nämlich nicht wie ich den Includepath angeben muss.

simple.pro


TEMPLATE =app
CONFIG += qt warn_off debug console
SOURCES = simple.cpp
TARGET = simple
REQUIRES=
QMAKE_CXXFLAGS_DEBUG += /EHsc


Hier sind die Fehlermeldungen


simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::printLegend(class QPainter *,class QRect const &)const " (?printLegend@QwtPlot@@MBEXPAVQPainter@@ABVQRect@@ @Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::printCanvas(class QPainter *,class QRect const &,class QMemArray<class QwtDiMap> const &,class QwtPlotPrintFilter const &)const " (?printCanvas@QwtPlot@@MBEXPAVQPainter@@ABVQRect@@ ABV?$QMemArray@VQwtDiMap@@@@ABVQwt
PlotPrintFilter@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::printScale(class QPainter *,int,int,int,int,class QRect const &)const " (?printScale@QwtPlot@@MBEXPAVQPainter@@HHHHABVQRec t@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::printTitle(class QPainter *,class QRect const &)const" (?printTitle@QwtPlot@@MBEXPAVQPainter@@ABVQRect@@@ Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::printLegendItem(class QPainter *,class QWidget const *,class QRect const &)const " (?printLegendItem@QwtPlot@@MBEXPAVQPainter@@PBVQWi dget@@ABVQRect@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::updateLegendItem(long)" ?updateLegendItem@QwtPlot@@MAEXJ@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::insertLegendItem(long)" (?insertLegendItem@QwtPlot@@MAEXJ@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::updateTabOrder(void)" (?updateTabOrder@QwtPlot@@MAEXXZ)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::drawCanvasItems(class QPainter *,class QRect const &,class QMemArray<class QwtDiMap> const &,class QwtPlotPrintFilter const &)const "
(?drawCanvasItems@QwtPlot@@MBEXPAVQPainter@@ABVQRe ct@@ABV?$QMemArray@VQwtDiMap@@
@@ABVQwtPlotPrintFilter@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::drawCanvas(class QPainter *)" (?drawCanvas@QwtPlot@@MAEXPAVQPainter@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::lgdClicked(void)" (?lgdClicked@QwtPlot@@MAEXXZ)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual void __thiscall QwtPlot::print(class QPainter *,class QRect const &,class QwtPlotPrintFilter const &)const " (?print@QwtPlot@@UBEXPAVQPainter@@ABVQRect@@ABVQwt PlotPrintFilter@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::drawContents(class QPainter *)" (?drawContents@QwtPlot@@MAEXPAVQPainter@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual void __thiscall QwtPlot::setMargin(int)" (?setMargin@QwtPlot@@UAEXH@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "protected: virtual void __thiscall QwtPlot::resizeEvent(class QResizeEvent *)" (?resizeEvent@QwtPlot@@MAEXPAVQResizeEvent@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual class QSize __thiscall QwtPlot::minimumSizeHint(void)const " (?minimumSizeHint@QwtPlot@@UBE?AVQSize@@XZ)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual class QSize __thiscall QwtPlot::sizeHint(void)const " (?sizeHint@QwtPlot@@UBE?AVQSize@@XZ)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual bool __thiscall QwtPlot::event(class QEvent *)" (?event@QwtPlot@@UAE_NPAVQEvent@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual bool __thiscall QwtPlot::qt_property(int,int,class QVariant *)" (?qt_property@QwtPlot@@UAE_NHHPAVQVariant@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual bool __thiscall QwtPlot::qt_emit(int,struct QUObject *)" (?qt_emit@QwtPlot@@UAE_NHPAUQUObject@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual bool __thiscall QwtPlot::qt_invoke(int,struct QUObject *)" (?qt_invoke@QwtPlot@@UAE_NHPAUQUObject@@@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual void * __thiscall QwtPlot::qt_cast(char const *)" (?qt_cast@QwtPlot@@UAEPAXPBD@Z)
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual char const * __thiscall QwtPlot::className(void)const " (?className@QwtPlot@@UBEPBDXZ)
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: virtual
__thiscall QwtPlot::~QwtPlot(void)" (??1QwtPlot@@UAE@XZ)', verwiesen in Funktion '$L36228'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: virtual
void __thiscall QwtPlot::replot(void)" (?replot@QwtPlot@@UAEXXZ)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: bool __thiscall QwtPlot::setMarkerXPos(long,double)" (?setMarkerXPos@QwtPlot@@QAE_NJN@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: bool __thiscall QwtPlot::setMarkerYPos(long,double)" (?setMarkerYPos@QwtPlot@@QAE_NJN@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: long __thiscall QwtPlot::insertLineMarker(class QString const &,int)" (?insertLineMarker@QwtPlot@@QAEJABVQString@@H@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: bool __thiscall QwtPlot::setCurveData(long,class QwtData const &)" (?setCurveData@QwtPlot@@QAE_NJABVQwtData@@@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: bool __thiscall QwtPlot::setCurvePen(long,class QPen const &)" (?setCurvePen@QwtPlot@@QAE_NJABVQPen@@@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)"(??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: long __thiscall QwtPlot::insertCurve(class QString const &,int,int)" (?insertCurve@QwtPlot@@QAEJABVQString@@HH@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: void __thiscall QwtPlot::setAxisTitle(int,class QString const &)" (?setAxisTitle@QwtPlot@@QAEXHABVQString@@@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: void __thiscall QwtPlot::setLegendPosition(enum QwtPlot::Position)" (?setLegendPosition@QwtPlot@@QAEXW4Position@1@@Z)' , verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: void __thiscall QwtPlot::setAutoLegend(bool)"(?setAutoLegend@QwtPlot@@QAEX_N@Z)', verwi
esen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: void __thiscall QwtPlot::setTitle(class QString const &)" (?setTitle@QwtPlot@@QAEXABVQString@@@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: __thiscall QwtPlot::QwtPlot(class QWidget *,char const *)" (??0QwtPlot@@QAE@PAVQWidget@@PBD@Z)', verwiesen in Funktion '"public: __thiscall Plot::Plot(void)" (??0Plot@@QAE@XZ)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: static class QMetaObject * __cdecl QwtPlot::staticMetaObject(void)" (?staticMetaObject@QwtPlot@@SAPAVQMetaObject@@XZ)' , verwiesen in Funktion '"public: virtual class QMetaObject * __thiscall QwtPlot::metaObject(void)const " (?metaObject@QwtPlot@@UB
EPAVQMetaObject@@XZ)'
simple.obj : error LNK2001: Nichtaufgelöstes externes Symbol "public: virtual class QwtDoubleRect __thiscall QwtData::boundingRect(void)const " (?boundingRect@QwtData@@UBE?AVQwtDoubleRect@@XZ)
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: __thiscall QwtData::QwtData(void)" (??0QwtData@@QAE@XZ)', verwiesen in Funktion '"public: __thiscall SimpleData::SimpleData(double (__cdecl*)(double),unsigned int)" (??0SimpleData@@QAE@P6ANN@ZI@Z)'
simple.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"public: virtual
__thiscall QwtData::~QwtData(void)" (??1QwtData@@UAE@XZ)', verwiesen in Funktion '"public: virtual __thiscall SimpleData::~SimpleData(void)" (??1SimpleData@@UAE@XZ)'
simple.exe : fatal error LNK1120: 40 unaufgelöste externe Verweise


Ich hab versucht unnötige Zeilenumbrüche zu entfernen.

Ach ja bevor ich es vergesse, wenn ich die Beispieldateien mit den vorgegeben .pro Dateien kompiliere bekomme ich zwar keine Fehlermeldung, aber die Programme laufen trotzdem nicht.

ich hoffe das hilft weiter. ;)

anda_skoa
06-01-2005, 18:36
In der .pro Datei deiner Applikation fehlt die Angabe für die QWT Bibliothek.
Vermutlich -lqwt also


LIBS += -lqwt


Ciao,
_

SWE_laie
06-01-2005, 19:31
Besten Dank dieser Tipp hat geholfen, aber wenn ich die .exe Datei ausführen will bekomme ich folgende Meldung:


QPaintDevice: Must construct a QApplication before a QPaintDevice


Wie ich schon vorher gesagt habe ist das eine unveränderte Beispieldatei von "qwt".

Mir ist noch was anders aufgefallen warum brauch ich immer noch die "qt-mtnc321.dll" Datei, obwohl ich mit der Qt Version 3.3.3 kompiliert habe?

anda_skoa
07-01-2005, 14:51
Wie sieht denn simple.cpp aus?

Ciao,
_

SWE_laie
07-01-2005, 18:24
Hallo hier kommt der Quellcode für simple.cpp.



#ifdef QWT_QTOPIA
#include <qpe/qpeapplication.h>
#endif
#include <qapplication.h>
#include <qwt_plot.h>
#include <qwt_data.h>
#include <math.h>

//-----------------------------------------------------------------
// simple.cpp
//
// A simple example which shows how to use QwtPlot and QwtData
//-----------------------------------------------------------------

class SimpleData: public QwtData
{
// The x values depend on its index and the y values
// can be calculated from the corresponding x value.
// So we don´t need to store the values.
// Such an implementation is slower because every point
// has to be recalculated for every replot, but it demonstrates how
// QwtData can be used.

public:
SimpleData(double(*y)(double), size_t size):
d_size(size),
d_y(y)
{
}

virtual QwtData *copy() const
{
return new SimpleData(d_y, d_size);
}

virtual size_t size() const
{
return d_size;
}

virtual double x(size_t i) const
{
return 0.1 * i;
}

virtual double y(size_t i) const
{
return d_y(x(i));
}
private:
size_t d_size;
double(*d_y)(double);
};

class Plot : public QwtPlot
{
public:
Plot();
};


Plot::Plot()
{
setTitle("A Simple QwtPlot Demonstration");
setAutoLegend(TRUE); // We want a legend
setLegendPosition(QwtPlot::Right);

// Set axis titles
setAxisTitle(xBottom, "x -->");
setAxisTitle(yLeft, "y -->");

// Insert new curves
long cSin = insertCurve("y = sin(x)");
long cCos = insertCurve("y = cos(x)");

// Set curve styles
setCurvePen(cSin, QPen(Qt::red));
setCurvePen(cCos, QPen(Qt::blue));

// Create sin and cos data
const int nPoints = 100;
setCurveData(cSin, SimpleData(::sin, nPoints));
setCurveData(cCos, SimpleData(::cos, nPoints));

// Insert markers

// ...a horizontal line at y = 0...
long mY = insertLineMarker("y = 0", QwtPlot::yLeft);
setMarkerYPos(mY, 0.0);

// ...a vertical line at x = 2 * pi
long mX = insertLineMarker("x = 2 pi", QwtPlot::xBottom);
setMarkerXPos(mX, 6.284);

replot();
}

int main(int argc, char **argv)
{
#ifdef QWT_QTOPIA
QPEApplication a(argc, argv);
#else
QApplication a(argc, argv);
#endif

Plot plot;
a.setMainWidget(&plot);
plot.resize(500,300);
plot.show();
return a.exec();
}

anda_skoa
10-01-2005, 17:24
Sieht ansich OK aus.
Entferne mal den Qt/Embedded Kram, also lass nur den #else Teil der Abfragen zu QWT_QTOPIA stehen.

Ciao,
_

SWE_laie
13-01-2005, 09:25
Hi
Danke für eure Hilfe das Problem hat sich erledigt :D

MfG
SWE_laie