[SOLVED] QWT 6.0 library in QT

  • Hi,
    I have downloaded QWT 6.0 from "svn co https://qwt.svn.sourceforge.net/svnroot/qwt/branches/qwt-6.0
    ":http://qwt.sourceforge.net/ . I am able to run the sample example that are provide within the same folder.
    But I need to use the same library for my projects. So i created a new project and copied the program tvplot from the qwt examples.

    I then added the following code in my .pro file

    @INCLUDEPATH += D:\Qwt\include
    DEPENDPATH += D:\Qwt\lib

    LIBS += -LD:\Qwt\lib

    win32 {
    CONFIG(debug, debug|release) {
    LIBS += -lqwtd
    } else {
    LIBS += -lqwt

    But when i compile and run it gives error "cannot open include file qmemarray.h" . I have searched on the net for the header files as well as how to setup qwt libraries. But didnt get this working on windows 7.

    Thanks for your time :)

  • QMemArray is a Qt3 relic. QVector would be the closest Qt4 equivalent. I have no idea why QWT tries to use it still... However, a quick search on "QMemArray Qwt" gives quite a number of hits. Perhaps your answer is among them?

  • Hi,
    Thanks for the reply Andre. I searched for "QMemArray Qwt" and have gone through all the links and solution in the first page. However I tried a different approach. I created a new Project in the same path where i have copied qwt e.g c:\qwt-6.0\examples. And then in the .pro file of my project i included

    @include( $${PWD}/../examples.pri )@

    Which is specified in all the .pro file in the example folder of QWT.

    It work and display the mainwindow with the charts. But if i create a folder in any other directory and then write

    @LOCATION = C:\qwt-6.0\examples

    include( $${LOCATION}/examples.pri )@

    It includes the files but shows the same error cannot include qmemarray.h

  • Moderators

    Soumitra, did you find a reference to qmemarray.h in the source for QWT? I have QWT 6.0.1 source and I could not find a reference to this header file within the whole source tree.
    Possibly the problem is triggered by something else.

  • Hi Koahnig,

    I couldnt find any reference to qmemarray.h . I searched for the file in the source folder but couldnt find one . When i click on the compiler error it opens qwt_array.h

    @/* -- mode: C++ ; c-file-style: "stroustrup" -- *****************************

    • Qwt Widget Library
    • Copyright (C) 1997 Josef Wilgen
    • Copyright (C) 2002 Uwe Rathmann
    • This library is free software; you can redistribute it and/or
    • modify it under the terms of the Qwt License, Version 1.0

    // vim: expandtab

    #ifndef QWT_ARRAY_H
    #define QWT_ARRAY_H

    #include "qwt_global.h"

    \def QwtArray
    Aliases QArray (Qt-2.x) and QMemArray (Qt-3.x) to QwtArray
    #ifdef QWT_NO_MEMARRAY
    #include <qarray.h>
    #define QwtArray QArray
    #include <qmemarray.h> <---Here this file is included.
    #define QwtArray QMemArray

    And even if i add qmemarray.h (source code from google search) Then the error changes to some other header file missing.

  • Moderators

    In which folder do you have qwt_array.h ?
    I do not find this in my source tree?

  • Hi koahnig,
    Sorry I was linking to the old library which i downloaded from "qwt":http://sourceforge.net/projects/qwt/. I switched the path to the current source library

    @INCLUDEPATH += C:\qwt-6.0\src
    DEPENDPATH += C:\qwt-6.0\lib

    LIBS += -LC:\qwt-6.0\lib@

    This works now for my project created in some other path. But I have written

    @LOCATION = C:\qwt-6.0\examples

    include( $${LOCATION}/examples.pri )@

    in my .pro which refers to the .pri file in qwt-6.0 source folder. This is working. Is this the right approach ?

  • Moderators

    If it compiles and you see no other issues, I would assume that it is correct. I am using QWT with MSVC and the include path is simply directed to src folder.
    I am rarely using .pro and .pri files under windows.

  • Thanks for the help. As of now this is working but if there is any problem i'll come back again :)
    I also need to implement the QwtPlot3D library too. I'll discuss that in other thread.

    Thanks for your time :)

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.