[gelöst] qwt unter qt 2009.03
[gelöst] qwt unter qt 2009.03
Hallo,
kann mir jemand sagen wie ich QWT in QT 2009.03 integrieren kann?
Ich arbeite mit qt-sdk-win-opensource-2009.03. Jetzt wollte ich Diagramme erstellen und habe gesehn dass es dafür QWT gibt.
Aber wie integriere ich QWT in QT 2009.03?
Wie benutze ich die QWT-Bibleotheken?
Vielen Dank
kann mir jemand sagen wie ich QWT in QT 2009.03 integrieren kann?
Ich arbeite mit qt-sdk-win-opensource-2009.03. Jetzt wollte ich Diagramme erstellen und habe gesehn dass es dafür QWT gibt.
Aber wie integriere ich QWT in QT 2009.03?
Wie benutze ich die QWT-Bibleotheken?
Vielen Dank
Zuletzt geändert von cimbomgs am 19. August 2009 16:12, insgesamt 1-mal geändert.
ich komm einfach nicht weiter
ich bekomme lauter Fehler. Ich will einfaches Example-Programm erstellen aber es klappt nicht.
simple.cpp:2:22: qwt_plot.h: No such file or directory
simple.cpp:3:29: qwt_plot_marker.h: No such file or directory
simple.cpp:4:28: qwt_plot_curve.h: No such file or directory
simple.cpp:5:24: qwt_legend.h: No such file or directory
simple.cpp:6:22: qwt_data.h: No such file or directory
simple.cpp:7:22: qwt_text.h: No such file or directory
simple.cpp:8:22: qwt_math.h: No such file or directory
Wie kann ich die Header einbinden?
Was muss ich machen?
ich bekomme lauter Fehler. Ich will einfaches Example-Programm erstellen aber es klappt nicht.
simple.cpp:2:22: qwt_plot.h: No such file or directory
simple.cpp:3:29: qwt_plot_marker.h: No such file or directory
simple.cpp:4:28: qwt_plot_curve.h: No such file or directory
simple.cpp:5:24: qwt_legend.h: No such file or directory
simple.cpp:6:22: qwt_data.h: No such file or directory
simple.cpp:7:22: qwt_text.h: No such file or directory
simple.cpp:8:22: qwt_math.h: No such file or directory
Wie kann ich die Header einbinden?
Was muss ich machen?
Danke...Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2009.03\qt
-- PATH set to C:\Qt\2009.03\qt\bin
-- Adding C:\Qt\2009.03\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++
...
C:\Qt\qwt-5.2.0\examples>cd simple_plot
C:\Qt\qwt-5.2.0\examples\simple_plot>qmake -project
C:\Qt\qwt-5.2.0\examples\simple_plot>qmake simple_plot.pro
C:\Qt\qwt-5.2.0\examples\simple_plot>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/qwt-5.2.0/examples/simple_plot'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..
\..\2009.03\qt\include\QtCore" -I"..\..\..\2009.03\qt\include\QtGui" -I"..\..\..
\2009.03\qt\include" -I"." -I"..\..\..\2009.03\qt\include\ActiveQt" -I"debug" -I
"..\..\..\2009.03\qt\mkspecs\win32-g++" -o debug\simple.o simple.cpp
simple.cpp:2:22: qwt_plot.h: No such file or directory
simple.cpp:3:29: qwt_plot_marker.h: No such file or directory
simple.cpp:4:28: qwt_plot_curve.h: No such file or directory
simple.cpp:5:24: qwt_legend.h: No such file or directory
simple.cpp:6:22: qwt_data.h: No such file or directory
simple.cpp:7:22: qwt_text.h: No such file or directory
simple.cpp:8:22: qwt_math.h: No such file or directory
simple.cpp:18: error: expected class-name before '{' token
simple.cpp:33: error: ISO C++ forbids declaration of `QwtData' with no type
simple.cpp:33: error: `QwtData' declared as a `virtual' field
simple.cpp:33: error: expected `;' before '*' token
simple.cpp:38: error: expected `;' before "virtual"
simple.cpp:58: error: expected class-name before '{' token
simple.cpp: In constructor `Plot::Plot()':
simple.cpp:66: error: `setTitle' was not declared in this scope
simple.cpp:67: error: `QwtLegend' has not been declared
simple.cpp:67: error: `QwtPlot' has not been declared
simple.cpp:67: error: `RightLegend' was not declared in this scope
simple.cpp:67: error: `insertLegend' was not declared in this scope
simple.cpp:70: error: `xBottom' was not declared in this scope
simple.cpp:70: error: `setAxisTitle' was not declared in this scope
simple.cpp:71: error: `yLeft' was not declared in this scope
simple.cpp:74: error: `QwtPlotCurve' was not declared in this scope
simple.cpp:74: error: `cSin' was not declared in this scope
simple.cpp:74: error: `QwtPlotCurve' is not a type
simple.cpp:76: error: `QwtPlotItem' has not been declared
simple.cpp:76: error: `RenderAntialiased' was not declared in this scope
simple.cpp:78: error: invalid use of undefined type `struct QPen'
../../../2009.03/qt/include/QtGui/../../src/gui/kernel/qwindowdefs.h:73: error:
forward declaration of `struct QPen'
simple.cpp:81: error: `cCos' was not declared in this scope
simple.cpp:81: error: `QwtPlotCurve' is not a type
simple.cpp:83: error: `QwtPlotItem' has not been declared
simple.cpp:85: error: invalid use of undefined type `struct QPen'
../../../2009.03/qt/include/QtGui/../../src/gui/kernel/qwindowdefs.h:73: error:
forward declaration of `struct QPen'
simple.cpp:96: error: `QwtPlotMarker' was not declared in this scope
simple.cpp:96: error: `mY' was not declared in this scope
simple.cpp:96: error: `QwtPlotMarker' is not a type
simple.cpp:99: error: `QwtPlotMarker' is not a class or namespace
simple.cpp:99: error: `HLine' was not declared in this scope
simple.cpp:104: error: `mX' was not declared in this scope
simple.cpp:104: error: `QwtPlotMarker' is not a type
simple.cpp:108: error: `QwtPlotMarker' is not a class or namespace
simple.cpp:108: error: `VLine' was not declared in this scope
simple.cpp:109: error: invalid use of undefined type `struct QPen'
../../../2009.03/qt/include/QtGui/../../src/gui/kernel/qwindowdefs.h:73: error:
forward declaration of `struct QPen'
simple.cpp:66: warning: unused variable 'setTitle'
simple.cpp:67: warning: unused variable 'RightLegend'
simple.cpp:67: warning: unused variable 'insertLegend'
simple.cpp:70: warning: unused variable 'xBottom'
simple.cpp:71: warning: unused variable 'yLeft'
simple.cpp:99: warning: unused variable 'HLine'
simple.cpp:108: warning: unused variable 'VLine'
simple.cpp: In function `int qMain(int, char**)':
simple.cpp:122: error: 'class Plot' has no member named 'resize'
simple.cpp:123: error: 'class Plot' has no member named 'show'
mingw32-make[1]: *** [debug/simple.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/qwt-5.2.0/examples/simple_plot'
mingw32-make: *** [debug] Error 2
C:\Qt\qwt-5.2.0\examples\simple_plot>
Ich habe bei mir in der Pro Datei folgendes stehen:
Da musst Du Deine Pfade anpassen und dann sollte das funktionieren.
Übrigens ist das ein generelles Vorgehen. Egal welche externe Lib man benutzt, man muss immer Include und Lib Pfade setzen.
Michael
Code: Alles auswählen
INCLUDEPATH += /usr/local/qwt-5.2.0/include
LIBS += -L/usr/local/qwt-5.2.0/lib/ \
-lqwt
Übrigens ist das ein generelles Vorgehen. Egal welche externe Lib man benutzt, man muss immer Include und Lib Pfade setzen.
Michael
Also ich mach das immer so:
Code: Alles auswählen
win*{
INCLUDEPATH += C:\QWT-5.2.0\src
LIBS += C:\QWT-5.2.0\lib
}
LIBS += -lqwt
ich bin ein Stück weiter gekommen aber wenn ich jetzt auf Ausführen klicke dann erschein folgender Fehler:
das ist alles was als Fehler angegeben wird
Code: Alles auswählen
:-1: error: collect2: ld returned 1 exit statusarbeitest du auch mit QT Creater?
Mani99 hat geschrieben:Also ich mach das immer so:
Code: Alles auswählen
win*{ INCLUDEPATH += C:\QWT-5.2.0\src LIBS += C:\QWT-5.2.0\lib } LIBS += -lqwt
Michael.Klank hat geschrieben:Unter "Ausgabe der Anwendung" findest Du noch mehr Hinweise. Aber so wies aussieht ein Linker Problem.
Michael
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
so sieht die pro-datei aus:
Code: Alles auswählen
#-------------------------------------------------
#
# Project created by QtCreator 2009-08-18T17:29:30
#
#-------------------------------------------------
TARGET = QWT_Test
TEMPLATE = app
SOURCES += main.cpp\
qwt_test.cpp
HEADERS += qwt_test.h
FORMS += qwt_test.ui
win*{
INCLUDEPATH += C:\QWT-5.2.0\src
LIBS += C:\QWT-5.2.0\lib
}
LIBS += -lqwt
underror: collect2: ld returned 1 exit status
haben nicht miteinander zu tun. Wenn der obige Fehler kommt hast Du mit Sicherheit eine andere Ausgabe. Aber wenn Du "QWT_Test.exe" hast, hat doch beim kompilieren alles geklappt. Nur darfst Du debug und release Versionen nicht mischen, was bei Dir so aussieht. Du hast bestimmt im QtCreator Debug angewählt. Also musst Du qwt auch in debug Mode kompilieren, einstellbar in "qwtconfig.pri".Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Starte D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe...
D:\QT_Projekte\QWT_Test\debug\QWT_Test.exe beendet, Rückgabewert 0
Die *.pro Datei musst Du auch anpassen. Hier ein Auszug von meiner:
Code: Alles auswählen
win32{
TEMPLATE = vcapp
INCLUDEPATH += C:\qt\Qwt\include
DEFINES += QT_DLL \
QWT_DLL
RESOURCES += QScope.qrc
RC_FILE = QScope.rc
Debug{
CONFIG += console
LIBS += -LC:\qt\Qwt\lib \
-lqwtd
}
Release{
CONFIG -= console
LIBS += -LC:\qt\Qwt\lib \
-lqwt
}
}