I have downloaded the QWT & want to use that for creation of graphs & charts. I am using Qt 4.7 for creating application. How to use Qwt in my application. How do I add the header file & library to my application?
1 Answers
Okay, disregard the previous answer. It was correct for any "random" library that doesn't use any special setup, but it looks like that QWT is slightly different. After reading Johnny's comment I realized that QWT provides an easier and more correct way of configuring a project to use it:
Install QWT according to the instructions in the INSTALL file, adjusting qwtconfig.pri as necessary (to configure installation paths etc.).
Then, according to the qmake manual, set the path to search for qwt.prf, for example by adding this to your project file or to qmake's command line parameters:
QMAKEFEATURES+=c:/Qwt-6.0.0-rc5/features
Of course, "c:/Qwt-6.0.0-rc5" should be replaced by the directory where QWT is really installed.
In your project file, add this line:
CONFIG += qwt

- 3,613
- 1
- 27
- 41

- 24,345
- 8
- 57
- 73
-
i have downloaded qwt6.0.0 & it does not have any include & lib folder. – amrit_neo Jan 29 '11 at 09:58
-
@amrit, this is just an example for any random library. If QWT has different directory structure, you need to specify actual directories where QWT installs its headers and libraries. It shouldn't be hard to locate them just by looking at directories or by doing a simple search for *.h, and *.a or *.lib (depending on the compiler used). Also you say you "have downloaded", but did you actually install it? There should be installation instructions in the downloaded package (unless it's an executable installer which should handle everything for you). – Sergei Tachenov Jan 29 '11 at 10:17
-
1@amrit, I have just downloaded the latest QWT beta (that's 6.0.0-rc5, not 6.0.0 which isn't out yet). It's exactly as I have guessed - when you install it (it goes to c:\Qwt-6.0.0-rc5 by default, can be changed by editing qwtconfig.pri), it puts the library named "qwt" (that is, libqwt.a/qwt.lib) in the "lib" subfolder and headers in the "include" subfolder. The installation instructions for different platforms are in the INSTALL file. – Sergei Tachenov Jan 29 '11 at 11:33
-
i am getting a problem that nothing is happening when i am using the command qmake qwt.pro and for nmake its showing unrecognized command. what is the mistake I am doing? – amrit_neo Jan 29 '11 at 13:57
-
@amrit, "nothing is happening" is probably the right thing. qmake follows the Unix philosophy of saying nothing if it has nothing to say. It should generate a Makefile, though. For nmake, it means that it either isn't installed (I guess it's a part of Visual Studio? Haven't used it.) or isn't in the PATH environment variable. If it's the latter, then you should try to run it with the full path, for example, "C:\Program Files\Visual Studio\nmake" or something similar. You could also try just "make" instead of "nmake", sometimes it just magically works (don't know when exactly). – Sergei Tachenov Jan 29 '11 at 14:06