PDA

View Full Version : How to build QWT-5.2 with Visual Studio 2005



rakkar
7th September 2009, 19:42
No offense, but frankly the instructions in the INSTALL file are horrible.

So to help others with the same difficulties I had, here is how to build and install QWT-5.2 with Visual Studio 2005


Make sure that Qt\2009.03\bin is in your PATH environment settings. %QTDIR%\bin\ was already in my path, but didn't work, so I also added C:\Qt\2009.03\qt\bin . IF you get an error about qmake not found, then the path didn't take
Edit qwt-5.2/qwtconfig.pri to build both release and debug, and you probably also want it not to build a dll
Open Start / All Programs / Microsoft Visual Studio 2005 / Visual Studio Tools / Visual Studio 2005 Command Prompt
cd to qwt-5.2
Type qmake qwt.pro
Type nmake
The static libraries will be in qwt-5.2\lib . Link these into your Visual Studio project
Header files are in qwt-5.2\src . Add this path to your Visual Studio project
Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .dll to Qt\2009.03\qt\plugins\designer
Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .exp to Qt\2009.03\qt\plugins\designer
Copy qwt-5.2\designer\plugins\designer\qwt_designer_plugin5 .lib to Qt\2009.03\qt\plugins\designer
Run Qt Designer
Click Help / About Plugins
Make sure qwt_designer_plugin5.dll is listed there


Here's the modified qwtconfig.pri



################################################## ####################
# Install paths
################################################## ####################

VER_MAJ = 5
VER_MIN = 2
VER_PAT = 1
VERSION = $${VER_MAJ}.$${VER_MIN}.$${VER_PAT}

unix {
INSTALLBASE = /usr/local/qwt-$$VERSION-svn
}

win32 {
INSTALLBASE = C:/Qwt-$$VERSION-svn
}

target.path = $$INSTALLBASE/lib
headers.path = $$INSTALLBASE/include
doc.path = $$INSTALLBASE/doc

################################################## ####################
# qmake internal options
################################################## ####################

CONFIG += qt # Also for Qtopia Core!
CONFIG += warn_on
CONFIG += thread

################################################## ####################
# release/debug mode
# If you want to build both DEBUG_SUFFIX and RELEASE_SUFFIX
# have to differ to avoid, that they overwrite each other.
################################################## ####################

VVERSION = $$[QT_VERSION]
isEmpty(VVERSION) {

# Qt 3
CONFIG += debug # release/debug
}
else {
# Qt 4
win32 {
# On Windows you can't mix release and debug libraries.
# The designer is built in release mode. If you like to use it
# you need a release version. For your own application development you
# might need a debug version.
# Enable debug_and_release + build_all if you want to build both.

#CONFIG += debug # release/debug/debug_and_release
CONFIG += debug_and_release
CONFIG += build_all
}
else {
CONFIG += debug # release/debug
}
}

################################################## ####################
# If you want to have different names for the debug and release
# versions you can add a suffix rule below.
################################################## ####################

DEBUG_SUFFIX =
RELEASE_SUFFIX =

win32 {
DEBUG_SUFFIX = d
}

################################################## ####################
# Build the static/shared libraries.
# If QwtDll is enabled, a shared library is built, otherwise
# it will be a static library.
################################################## ####################

#CONFIG += QwtDll

################################################## ####################
# QwtPlot enables all classes, that are needed to use the QwtPlot
# widget.
################################################## ####################

CONFIG += QwtPlot

################################################## ####################
# QwtWidgets enables all classes, that are needed to use the all other
# widgets (sliders, dials, ...), beside QwtPlot.
################################################## ####################

CONFIG += QwtWidgets

################################################## ####################
# If you want to display svg imageson the plot canvas, enable the
# line below. Note that Qwt needs the svg+xml, when enabling
# QwtSVGItem.
################################################## ####################

#CONFIG += QwtSVGItem

################################################## ####################
# If you have a commercial license you can use the MathML renderer
# of the Qt solutions package to enable MathML support in Qwt.
# So if you want this, copy qtmmlwidget.h + qtmmlwidget.cpp to
# textengines/mathml and enable the line below.
################################################## ####################

#CONFIG += QwtMathML

################################################## ####################
# If you want to build the Qwt designer plugin,
# enable the line below.
# Otherwise you have to build it from the designer directory.
################################################## ####################

CONFIG += QwtDesigner

################################################## ####################
# If you want to auto build the examples, enable the line below
# Otherwise you have to build them from the examples directory.
################################################## ####################

#CONFIG += QwtExamples

GimpMaster
19th October 2009, 18:44
This worked great. The only thing I would add is to type

nmake install

This will create a folder in windows under:

c:\Qwt-XXX-svn

that has the

\includes and
\lib

also it takes care of coping the plugins to the designer plugin folder.