View Full Version : Qwt examples are working but,Not able to run selfdesigned qwt applications!

11th March 2008, 16:43
Hello! Friends,
I am working in WinXp with Qt4.3.4. Also i have installed qwt library and can use qwt plugin in Qt. All the qwt examples are compiled and working properly.

But today i tried to design a simple GUI widget form containing 2 pushbuttons & QwtPlot widget, but getting following error's.

In file included from main.cpp:3:
sampleplot.h:5:22: qwt_plot.h: No such file or directory
sampleplot.h:7:28: qwt_plot_curve.h: No such file or directory
sampleplot.h:8:27: qwt_scale_map.h: No such file or directory
In file included from sampleplot.h:10,
from main.cpp:3:
ui_sampleplot.h:30: error: ISO C++ forbids declaration of `QwtPlot' with no type

ui_sampleplot.h:30: error: expected `;' before '*' token
ui_sampleplot.h: In member function `void Ui_sampleForm::setupUi(QWidget*)':
ui_sampleplot.h:54: error: `sampleqwtPlot' was not declared in this scope
ui_sampleplot.h:54: error: `QwtPlot' has not been declared
In file included from main.cpp:3:
sampleplot.h: At global scope:
sampleplot.h:16: error: expected class-name before ',' token
sampleplot.h:37: error: ISO C++ forbids declaration of `QwtPlotCurve' with no ty
sampleplot.h:37: error: expected `;' before '*' token
main.cpp: In function `int qMain(int, char**)':
main.cpp:8: error: 'class samplePlot' has no member named 'show'
main.cpp:11:2: warning: no newline at end of file
mingw32-make[1]: *** [release/main.o] Error 1
mingw32-make[1]: Leaving directory `C:/Shishir/Self Examples/Sample_Plot'
mingw32-make: *** [release] Error 2

From this it seems that it is not able to find the qwt files, but all qwt examples are working that means it can find them!!!!

Can anyone please help me out in this.-->I will be obliged.:)

Thanks in advance.

11th March 2008, 19:59
You have to tell the compiler where to look header files and libs for. Did you notice that every .pro file of those Qwt examples includes a .pri file which further adds stuff like INCLUDEPATH and LIBS.

12th March 2008, 13:40
Hello Jpn,
Thanks for helping me out, but i knew that all those examples include qwtconfig.pri file from where they get to know all paths. But in my case as i was generating the .pro file with qmake it wasn't including it. So is there any other option to do?

Anyway now i wrote the .pro file and included them as shown: -

//.pro file for the sampleplot from where we get to include qwtconfig.pri file eventually to include all the required qwt headers.

include( ../../../Qt/qwt-5.0.2/examples/examples.pri )

# Input
HEADERS += sampleplot.h
FORMS += sampleplot.ui
SOURCES += main.cpp sampleplot.cpp

But even then its not working. Thanks again for helping.:)

12th March 2008, 13:45
No, you can't include Qwt's examples.pri file unless you put your application in the same directory where Qwt examples are. Just add similar lines to your own .pro but with suitable path to Qwt.

12th March 2008, 15:50
Hey Thanks Jpn all those errors are gone but facing with new problem, i mean i got the .exe but its not working. Showing "encountered problem while launching the application".

12th March 2008, 16:13
In other words... it crashes? You might want to use a debugger to find out what's the problem.

26th March 2008, 10:16
Hi i have the same problem as u. I can run the qwt examples. Can u pls give me a example code on how make a selfdesigned qwt application in VS2005 integrated with Qt4.3.3. I tried so much on the net but in vain. Help. !!!

Thank You.

9th May 2009, 22:31
could you please tell me how to write it then, I also have the same problem, thank you:)