How to add qwt to a project?



  • I want to use qwt in a project. I have downloaded qwt to C:/

    then I opened up the Qt command line, and in the qwt-6.1.3 directory ran these commands:

    qmake
    mingw32-make
    mingw32-make install
    

    all ran to completion.

    Then in QTCreator, I opened my project and clicked the Projects button on the sidebar. I added to my PATH this:

    C:\qwt-6.1.3\lib
    

    Then I added the following line to my .pro file:

    CONFIG += qwt
    

    and finally I add the following to my header file:

    #include <qwt_plot.h>
    

    And then I try building. The error I receive is 'qwt_plot.h: No such file or directory'

    What am I missing? Why is this file not being found? I also tried separately adding these following lines:

    LIBS += -lqwt
    LIBS += -L$${QWT_LOCATION}/lib/qwt
    LIBS += -L$${QWT_LOCATION}/lib/libqwt
    

    but all fail.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Did you follow the Qwt installation guide ?

    Note that the Qwt community has its own forum and channels that might get you help quicker.


  • Moderators

    @M_zx_7

    The include path to your header files ist missing.

    [deleted, koahnig]



  • @koahnig Thank you, I will try these suggestions.



  • @koahnig Please excuse me for voting you down, but leaving answers like this one uncorrected causes a nightmare for me as package maintainer with users finding it in the archives going into the totally wrong direction.

    The idea of feature files ( CONFIG += qwt ) is that a user does not have to deal with the details you have posted and worst of all the answer is the opposite of, what the standard installation process is about. The commands for building Qwt ( or its examples ) are not the same as those you need for using it !

    The missing step instead is to configure qmake being able to resolve CONFIG += qwt, what basically means setting a path to where qwt.prf had been installed. How to do so is documented in http://qwt.sourceforge.net/qwtinstall.html#COMPILEANDLINKAPP.

    In case of not willing to work with a feature files, the correct commands to be copied into the application project file can be found inside the installed qwt.prf file - but not in the project files inside of the Qwt tarball for building the examples !!!


  • Moderators

    @uwer

    Thanks for correcting my view.

    I think I never had the "CONFIG += qwt" in my code. I am wondering how this could happen since it had been modified from a qwt example some time back.

    I understand and agree with your comment for creating nightmares in support, therefore I am deleting the entry above.



  • Hi
    I have a project and I want to use qwt_text in it .
    So I installed qwt . Now I don't know how to include qwt_text in it:confused:

    I mean what are the neccessary changes that I have to make in my .pro file .

    I use ubuntu 10.10 , QtCreator 2.0.1 , Qt 4 , Qwt 5.2.1

    web design


  • Lifetime Qt Champion

    Hi,

    Follow @uwer's advices and the link he posted.


Log in to reply
 

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