Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Building Qwt with Qt5



  • I am trying to install Qwt version qwt-5.2 and my Qt version is Qt 5.5.0.
    I installed Qwt using svn command

    svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-5.2 
    

    Then i ran qmake qwt.pro which gave me cannot find /usr/lib/i386-linux-gnu/qt4/bin/qmake so i installed qmake using apt-get install qt4 qmake . which allowed me to run make

    root@user-ThinkCentre-A70:/home/user/qwt-5.2# make
    cd src/ && make -f Makefile 
    make[1]: Entering directory `/home/user/qwt-5.2/src'
    compiling qwt_abstract_scale_draw.cpp
    qwt_abstract_scale_draw.cpp:12:22: fatal error: qpainter.h: No such file or directory
     #include <qpainter.h>
                          ^
    compilation terminated.
    make[1]: *** [obj/qwt_abstract_scale_draw.o] Error 1
    make[1]: Leaving directory `/home/user/qwt-5.2/src'
    make: *** [sub-src-make_default-ordered] Error 2
    

    with qtchooser (/usr/lib/i386-linux-gnu/qt-default/qtchooser/default.conf) saying

    /usr/lib/i386-linux-gnu/qt4/bin
    /usr/lib/i386-linux-gnu
    

    So removed Qwt-5.2 and installed Qwt-6.1 which allowed to run qmake but not make

    root@user-ThinkCentre-A70:/home/rathan/qwt-6.1# make
    cd src/ && /usr/lib/i386-linux-gnu/qt4/bin/qmake /home/user/qwt-6.1/src/src.pro -o Makefile
    cd src/ && make -f Makefile 
    make[1]: Entering directory `/home/rathan/qwt-6.1/src'
    compiling qwt_abstract_scale_draw.cpp
    In file included from qwt_abstract_scale_draw.h:13:0,
                     from qwt_abstract_scale_draw.cpp:10:
    qwt_global.h:13:21: fatal error: qglobal.h: No such file or directory
     #include <qglobal.h>
                         ^
    compilation terminated.
    make[1]: *** [obj/qwt_abstract_scale_draw.o] Error 1
    make[1]: Leaving directory `/home/user/qwt-6.1/src'
    make: *** [sub-src-make_default-ordered] Error 2
    

    with qtchooser edited to (/usr/lib/i386-linux-gnu/qt-default/qtchooser/default.conf) with no joy.

    /usr/lib/i386-linux-gnu/qt5/bin
    /usr/lib/i386-linux-gnu
    

    But my qmake is in /opt/Qt5.5.0/5.5/gcc/bin/qmake path so just pointed the qtchooser to it to check if it works but it gave me

    root@user-ThinkCentre-A70:/home/user/qwt-6.1# make
    cd src/ && ( test -e Makefile || /opt/Qt5.5.0/5.5/gcc/bin/qmake /home/user/qwt-6.1/src/src.pro -o Makefile ) && make -f Makefile 
    make[1]: Entering directory `/home/user/qwt-6.1/src'
    make[1]: *** No rule to make target `/usr/share/qt4/mkspecs/linux-g++/qmake.conf', needed by `Makefile'.  Stop.
    make[1]: Leaving directory `/home/user/qwt-6.1/src'
    make: *** [sub-src-make_first-ordered] Error 2
    

    what is that i missed??



  • I've used Qwt 6.1 with Qt 5.5 (and 5.6). It looks like your problem is mixing Qt versions. Did you re-run qmake using the 5.5 qmake (you might have to completely clean the build folder instead of just re-running the correct qmake).



  • Hi! I just tried it myself. I'm on openSUSE leap 42 and I'm using Qt5.6.0 (gcc 64 bit). This Qt version is installed in /opt/Qt5.6.0. The following works for me:

    • Download qwt-6.1.2.tar.bz2 to ~/Downloads/qwt-6.1.2.tar.bz2
    • Extract to ~/Downloads/qwt-6.1.2
    • Start Qt Creator. Open project: ~/Downloads/qwt.pro. Configure project with kit of your choice. I used gcc 64.
    • Build project for release (takes some time).
    • Close Qt Creator.
    • Open a terminal.
    • cd ~/Downloads/build-qwt-Desktop_Qt_5_6_0_GCC_64bit-Release/
    • become superuser: su (enter password)
    • make install
    • back to normal user: exit
    • append the following to ~/.bashrc:
    QT_PLUGIN_PATH="/usr/local/qwt-6.1.2/plugins:$QT_PLUGIN_PATH"
    export QT_PLUGIN_PATH
    
    • log out of current x session and log in again (or reboot, what ever)

    • Start Qt Creator. Create new Widgets project. Go to forms designer. Qwt widgets are now available. Add one of the widgets to your main form.

    • Go to the new project's *.pro file. Include qwt there, so the file should look similar to this:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = untitled5
    TEMPLATE = app
    
    # ****** INCLUDE QWT  *********
    include ( /usr/local/qwt-6.1.2/features/qwt.prf )
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    FORMS    += mainwindow.ui
    
    • Run your shiny new program :-)


  • @mchinand
    Thanks for the reply . Yes i did re-run qmake using 5.5.
    @Wieland
    Woow!
    Thanks . It just worked for me :)


Log in to reply