Install Qwt for Multiple Qt SDKs on Windows

I’ve installed Qt-4.8.6-MinGW and Qt-5.3.1-MSVC2013_64 together, because I’m going to build my application both 32bit (MinGW) and 64bit (MSVC2013). So I have to build Qwt for both Qt SDKs. What’s more, I’m using the only one QtCreator installed by Qt-5.3.1-MSVC2013_64, which has to support both SDKs with the same source code.

1. Build and Install Qwt Plugin for QtCreator
As said in Qwt User’s guide, QtCreator is “a different version of the Qt libraries you want to build your application with”, QtCreator supplied by Qt5 installed is built with MSVC2010 32bit (QtCreator –> Help –> About Qt Creator).
a) Build Qwt with MSVC2010 x86 Qt5 SDK (NOTICE: same version as QtCreator) first, and get plugin for QtCreator.
Just build following the user’s guide: update qwtconfig.pri, qmake qwt.pro, nmake, and nmake install.
b) Install plugin
Copy $QWT_INSTALL_PREFIX\plugins\designer\qwt_designer_plugin.dll to X:\Qt\Qt5.3.1\5.3\Tools\QtCreator\bin\plugins\designer\

2. Install Qwt Documentation
Open QtCreator, Tools –> Options –> Help –> Documentation –> Add
Select qwt-6.1.0.qch file downloaded from Qwt site

3. Build and Install Qwt Headers/Libraries for Qt SDKs
a) Build and Install Qwt with MSVC2013 x64 Qt5 SDK
     Build and install as the user’s guide, and then copy features/* (qwt.prf, qwtconfig.pri and qwtfunctions.pri) to X:\Qt\4.8.6_mingw482\mkspecs\features\win32\
b) Build and Install Qwt with MinGW x86 Qt4 SDK
     Build and install as the user’s guide, and then copy features/* (qwt.prf, qwtconfig.pri and qwtfunctions.pri) to D:\Qt\Qt5.3.1\5.3\msvc2013_64_opengl\mkspecs\features\win32\

4. Test
Copy qwt-6.1.0\examples\simpleplot.cpp to a test directory, let’s use “X:\simpleplot\”.
Create X:\simpleplot\simpleplot.pro with the following contents:

QT       += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG   += qwt
TARGET    = simpleplot
TEMPLATE  = app
SOURCES   =  simpleplot.cpp

Open project with QtCreator (you can see Qwt in UI designer now)

If you built Qwt with shared library (*.dll), maybe you should copy qwt.dll to the folder your exe exists.

[Reference]
http://qwt.sourceforge.net/qwtinstall.html
http://qt-project.org/doc/qt-4.8/qmake-advanced-usage.html#adding-new-configuration-features

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s