Problem with building the project with qwt module
First part:
''''''''''''''''''
I've installed qwt-6.0.1 in C:\qwt-6.0.1\ by following steps:
qmake qwt.pro
mingw32-make
mingw32-make install
Then I tried this for running examples:
cd examples
qmake examples.pro
mingw32-make
So with this I'm successfully able open examples in Qt creator, build & run given in the C:\qwt-6.0.1\examples directory.
Second Part:
'''''''''''''''''''''''''
I've created a project in D:\My_App\ directory. I want to use qwt library to draw required graphs. In examples I find some files with .pri extension, but I don't have any in my project folder. Then I edited my My_App.pro file to configure the paths:
# Project created by QtCreator 2012-04-18T09:43:46
#
#-------------------------------------------------
QT += core gui
INCLUDEPATH += C:\qwt-6.0.1\include
LIBS += -L"C:\qwt-6.0.1\lib" \
-lqwtd \
-lqwt
TARGET = My_Application
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
paramdisplaywindow.cpp \
paramwidget.cpp \
devicestate.cpp \
loginscreen.cpp \
graphdialog.cpp
HEADERS += mainwindow.h \
paramdisplaywindow.h \
paramwidget.h \
devicestate.h \
loginscreen.h \
graphdialog.h
#-------------------------------------------------------------------------
If I build the project in Qt creator, the following warning message is appearing:
"warning: auto-importing has been activated without --enable-auto-import specified on the command line."
Then if I run the project, the following message: "The program has unexpectedly finished."
Is that all I need to add in .pro file. Where am I doing the mistake ? Please help me with this. Thank you.
Re: Problem with building the project with qwt module
Read the INSTALL file about how to use "CONFIG += qwt".
Uwe
Re: Problem with building the project with qwt module
Quote:
Originally Posted by
Uwe
Read the INSTALL file about how to use "CONFIG += qwt".
Uwe
Before doing that I didn't understand the other line in the INSTALL instructions, please help me understand the following lines.
Quote:
Windows doesn't like mixing of debug and release binaries. Most
of the problems with using the Qwt designer plugin are because
of trying to load a Qwt debug library into a designer release
executable.
Don't forget to tell qmake where to find qwt.prf:
qmake -set QMAKEFEATURES ...
I use Qt creator to build & run the project. Does this mean that this following lline applies to me?
Thank you.
Re: Problem with building the project with qwt module
Quote:
Originally Posted by
rawfool
I use Qt creator to build & run the project. Does this mean that this following line applies to me?
Sure the creator uses qmake.
Uwe
Re: Problem with building the project with qwt module
Uwe, I read the INSTALL manual and also read other threads where you have explained this process to fellow people.
OK,
Now I did this using command line terminal Qt 4.7.4 for Desktop (MinGW).
Quote:
qmake -set QMAKEFEATURES "C:\qwt-6.0.1\features"
Though I used mingw32-make during installation, in the above step to set QMAKEFEATURES, I used just qmake (this I followed by looking at the other threads).
Then I've added CONFIG += qwt in my My_App.pro file. I'm getting errors like error: qwt_plot.h: No such file or directory. I think I've to mention include path, but I don't know where. Please help me further.
Note: My .pro file is in D:\My_App\ directory, but my qwt installation is in C:\qwt-6.0.1\ directory. Does this make any difference?
My .pro file looks like this. Is it correct ? Where's the problem?
Quote:
#-------------------------------------------------
#
# Project created by QtCreator 2012-04-18T09:43:46
#
#-------------------------------------------------
QT += core gui
CONFIG += qwt
TARGET = My_Application
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
paramdisplaywindow.cpp \
paramwidget.cpp \
devicestate.cpp \
loginscreen.cpp \
graphdialog.cpp
HEADERS += mainwindow.h \
paramdisplaywindow.h \
paramwidget.h \
devicestate.h \
loginscreen.h \
graphdialog.h
Re: Problem with building the project with qwt module
Check the window, where you find the compiler commands. Here you should see the include paths, that are used for compiling your code ( maybe add "CONFIG -= silent", when the output is suppressed ). I would guess, that the Qwt install directory is not there.
If true it means, that your QMAKEFEATURES is not set properly - or set for a different qmake environment, that the one that is used by the creator.
Uwe
Re: Problem with building the project with qwt module
my output is
Quote:
D:\AIMS_App\AIMS_Application>qmake -project
D:\AIMS_App\AIMS_Application>qmake
D:\AIMS_App\AIMS_Application>mingw32-make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `D:/AIMS_App/AIMS_Application'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -
DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -
DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\QtSDK\
Desktop\Qt\4.7.4\mingw\include\QtCore" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\includ
e\QtGui" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\include" -I"." -I"c:\QtSDK\Desktop\Q
t\4.7.4\mingw\include\ActiveQt" -I"debug" -I"c:\QtSDK\Desktop\Qt\4.7.4\mingw\mks
pecs\default" -o debug\graphdialog.o graphdialog.cpp
In file included from graphdialog.cpp:1:
graphdialog.h:6:22: error: qwt_plot.h: No such file or directory
graphdialog.h:7:29: error: qwt_plot_layout.h: No such file or directory
graphdialog.h:8:24: error: qwt_legend.h: No such file or directory
graphdialog.h:9:29: error: qwt_legend_item.h: No such file or directory
graphdialog.h:10:32: error: qwt_plot_histogram.h: No such file or directory
graphdialog.h:11:27: error: qwt_plot_grid.h: No such file or directory
In file included from graphdialog.cpp:1:
graphdialog.h:14: error: expected class-name before '{' token
graphdialog.cpp: In constructor 'GraphDialog::GraphDialog(QDialog*)':
graphdialog.cpp:4: error: class 'GraphDialog' does not have any field named 'Qwt
Plot'
mingw32-make[1]: *** [debug/graphdialog.o] Error 1
mingw32-make[1]: Leaving directory `D:/AIMS_App/AIMS_Application'
mingw32-make: *** [debug] Error 2
Now after I do this, my .pro file is also changed. I cannot find the line CONFIG += qwt which I added before doing the above process.
Now my .pro file looks like
Quote:
################################################## ####################
# Automatically generated by qmake (2.01a) Tue Apr 24 12:49:50 2012
################################################## ####################
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
# Input
HEADERS += devicestate.h \
graphdialog.h \
loginscreen.h \
mainwindow.h \
paramdisplaywindow.h \
paramwidget.h
SOURCES += devicestate.cpp \
graphdialog.cpp \
loginscreen.cpp \
main.cpp \
mainwindow.cpp \
paramdisplaywindow.cpp \
paramwidget.cpp
Any suggestions Uwe, please..
Re: Problem with building the project with qwt module
Without "CONFIG += qwt" there are no include paths.
I suggest you should spend some time on learning how to use the creator - for questions better ask on creator related support channels.
Uwe
Re: Problem with building the project with qwt module
Oh Uwe, I got it working. Finally !!
Thank you very much for all the suggestions and for creating the library itself.
I've created a custom class in my project like this
Quote:
#ifndef GRAPHDIALOG_H
#define GRAPHDIALOG_H
#include <qwt.h>
#include <qwt_plot.h>
class GraphDialog : public QwtPlot
{
Q_OBJECT
public:
explicit GraphDialog(QWidget *parent = 0);
signals:
public slots:
};
#endif // GRAPHDIALOG_H
Though I didn't start using the library functions itself, now, I'm able to build the project. But I have a small hiccup.
It's displaying two warning messages which I'm not able to figure out.
Quote:
D:\AIMS_App\AIMS_Application\graphdialog.h:5: from graphdialog.h:5,
c:\Qwt-6.0.1\include\qwt_interval.h:270: warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkage
c:\Qwt-6.0.1\include\qwt_plot.h:17: In file included from c:\Qwt-6.0.1\include/qwt_plot.h:17,
c:\Qwt-6.0.1\include\qwt_interval.h:270: warning: 'bool QwtInterval::isValid() const' redeclared without dllimport attribute after being referenced with dll linkage
What are those warnings?
Thank you very much.
Re: Problem with building the project with qwt module
Quote:
Originally Posted by
rawfool
What are those warnings?
These warning are because of two inlined methods, that are declared in the wrong order in qwt_interval.h.
You can ignore them or use Qwt from the SVN 6.0 branch, where it has been fixed.
Uwe
Re: Problem with building the project with qwt module
BTW, which model is the best exmaple to start learning Qwt?
Thanks.
Re: Problem with building the project with qwt module
That depends on your requirements dude. If u want specific type, then look at the corresponding examples for getting started. Either way you choose an example to start, then go further with your own learning from the manual.