PDA

View Full Version : Qt 5.2.0 and Qwt 6.1.0



8Observer8
4th January 2014, 09:38
Hi

I will show you the error and my project files.

Error:


Starting D:\Documents\Qt\QwtExamples\0003_EmptyPlot_for_Qt5 \build-EmptyPlot_for_Qt5-Desktop_Qt_5_2_0_MinGW_32bit-Debug\debug\EmptyPlot_for_Qt5.exe...
QWidget: Must construct a QApplication before a QWidget
Invalid parameter passed to C runtime function.
Invalid parameter passed to C runtime function.


EmptyPlot_for_Qt5.pro



QWT_LOCATION = c:/Qwt-6.1.0
INCLUDEPATH += $${QWT_LOCATION}/include
LIBS = -L$${QWT_LOCATION}/lib \
-lqwt

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

SOURCES += \
main.cpp


main.cpp


#include <QApplication>
#include <qwt_plot.h>

int main(int argc, char **argv)
{
QApplication app(argc, argv);

QwtPlot plot;
plot.show();

return app.exec();
}


Thank you!

Uwe
4th January 2014, 10:18
AFAIR this is a build issue unrelated to fhe Qt or Qwt version. Look into the archive how to solve it ( I don't use Windows myself but it might be because of "DEFINES *= QWT_DLL" is missing ).

To avoid issues like this one install Qwt in the recommended way and use "CONFIG += qwt" instead of ttrying to figure out your profile manually. But if you insist on doing it yourself - at least have a look at qwt.prf to see what needs to be done.

Uwe

8Observer8
4th January 2014, 10:39
I don't use Windows myself but it might be because of "DEFINES *= QWT_DLL" is missing

Where? I don't understand. Before installing? What is the file?


To avoid issues like this one install Qwt in the recommended way and use "CONFIG += qwt"

What is "recommended way"? I installed qwt like this:

- in "qwtbuild.pri":

#CONFIG += silent

- in console:


qmake qwt.pro
mingw32-make
mingw32-make install


- I see this files in "C:\Qwt-6.1.0\lib":


libqwt.a
libqwtd.a
qwt.dll
qwt.lib
qwtd.dll
qwtd.lib

Eric89GXL
1st February 2014, 23:40
I just had the same problem. Try linking to "-lqwtd" instead if you are going to use debugging.