PDA

View Full Version : Can I use Qwt with Microsoft compiler or not?



8Observer8
2nd August 2013, 20:30
Hi,

Can I use Qwt whit Microsoft compiler?

I use Qt 4.8.5 and Microsoft Visual C++ Compiler 10.0 (x86)

It requires "qwt.lib". But I don't know how to create "qwt.lib".

Thank you!

alainstgt
4th August 2013, 09:15
yes of course you can.

I can send you by mail a complete description of the procedure, just drop me your email account name.

Alain

8Observer8
4th August 2013, 09:28
Thank you!

8observer8@gmail.com

8Observer8
5th August 2013, 08:36
I try to run an example.

plot.pro

SOURCES += \
main.cpp

CONFIG += qwt

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

main.cpp

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

int main(int argc, char* argv[])
{
// this is a simple plot without any data!
QApplication app(argc,argv);

QwtPlot *myPlot = new QwtPlot;
myPlot->setTitle("my first plot");
myPlot->setCanvasBackground(QColor(Qt::darkBlue));
myPlot->show();

return app.exec();
}

Output:

QWidget: Must construct a QApplication before a QPaintDevice
D:\Documents\Qt\HelloPlot\build-HelloPlot-Microsoft_Visual_C-Debug\debug\HelloPlot.exe exited with code 1

What should be in qwtconfig.pri? "CONFIG += QwtDll" or "#CONFIG += QwtDll"? or no difference?

I use:
- Visual Studio Command Prompt (2010)
- Qt4.8.5
- Qwt-6.1.0
- Compiler: Microsoft Visual C++ Compiler 10.0 (x86)

Uwe
5th August 2013, 09:14
What should be in qwtconfig.pri? "CONFIG += QwtDll" or "#CONFIG += QwtDll"? or no difference?
qwtconfig.pri is for building Qwt itself, not for building an application using Qwt.

Almost everything above shows that you didn't read: http://qwt.sourceforge.net/qwtinstall.html.

Uwe

8Observer8
5th August 2013, 10:06
I mean when I install Qwt Should I to comment out this line: CONFIG += QwtDll

Uwe
5th August 2013, 10:53
Depends on if you want to build Qwt as a shared or as a static library. See http://en.wikipedia.org/wiki/Library_%28computing%29

Uwe

8Observer8
5th August 2013, 11:18
Why my example doesn't work? I did everything according to the instructions.

Uwe
5th August 2013, 11:52
Remove the lines 6-9 from your plot.pro ( expanding the include path and library list is done by CONFIG += qwt ! ) and recompile from scratch.
If your code doesn't compile because of not finding Qwt headers you didn't configure qmake properly and "CONFIG += qwt" didn't work, what could be the reason for problem above.

Uwe

8Observer8
5th August 2013, 11:59
How to configure qmake properly?

Uwe
5th August 2013, 12:16
Read: http://qwt.sourceforge.net/qwtinstall.html.