How to Install Qt 5 and Qwt on CentOS 6

  • If you are trying to install Qt and "Qwt ": (Qt Widgets for Technical Applications) on CentOS, then the following instructions should be of good use. I created these steps, after many a trial and error, using Qt 5.1.1 and Qwt 6.1.0 on CentOS 6.4 x86 64bit. These steps have proven to work on several CentOS machines and could also work on Fedora and Red Hat.

    Feel free to use newer versions of the install packages, but just make sure to alter the version numbers in the steps as applicable. Also, most dependencies are covered in these instructions, but there may be others that you will have to find if something fails to build properly.

    Installing Qt 5.1.1 on CentOS 6.4

    1. Install Development Tools
      @sudo yum groupinstall "Development Tools"@

    2. Install glibc-devel.i686 (the 32-bit version is required to build GCC)
      @sudo yum install glibc-devel.i686@

    3. Download and install "GCC ": 4.8.1 or latest version. Instructions copied from "here":
      @tar xvjf gcc-4.8.1.tar.bz2
      cd gcc-4.8.1
      cd ..
      mkdir objdir
      cd objdir
      $PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1
      sudo make install@

    4. Copy new GCC libraries to /usr/lib64
      @sudo mv /usr/lib64/ /usr/lib64/
      sudo cp -P /opt/gcc-4.8.1/lib64/ /usr/lib64
      sudo cp /opt/gcc-4.8.1/lib64/ /usr/lib64/
      sudo ldconfig -v@

    5. Download and install "Qt": 5.1.1 or latest version
      @sudo ./

    6. Add Qt commands to PATH (e.g. qmake)

    • Create file
      @sudo gedit /etc/profile.d/

    • Add the following lines to
      export PATH@

    • Save and close

    • Run
      @. /etc/profile.d/

    • Verify that qmake is version 5.1.1
      @which qmake@

    1. Edit Qt Creator desktop configuration file to allow all users to run
      @sudo gedit /usr/share/applications/DigiaQtOpenSource-qtcreator.desktop@
    • Comment out or remove the line “Path=/root”
    • Save and close DigiaQtOpenSource-qtcreator.desktop

    Installing Qwt 6.1.0 on CentOS 6.4

    1. Install mesa-libGLU-devel
      @sudo yum install mesa-libGLU-devel@

    2. Download and install "Qwt ": 6.1.0 or latest version
      @tar xvjf qwt-6.1.0.tar.bz2
      cd qwt-6.1.0@

    • Configure qwtconfig.pri
      @gedit qwtconfig.pri@
    • Change QWT_INSTALL_PREFIX to “/opt/qwt-$$QWT_VERSION”
    • Configure rest of qwtconfig.pri and comment/uncomment plugins as desired
    • Save and close qwtconfig.pri
    • Build and install Qwt
      sudo make install@
    1. Link Qwt plugin to Qt
      @sudo ln -s /opt/qwt-6.1.0/plugins/designer/ /opt/Qt5.1.1/Tools/QtCreator/bin/plugins/designer/@

    2. Create qwt configuration file
      @echo /opt/qwt-6.1.0/lib | sudo tee /etc/
      sudo ldconfig -v@

    3. Add the following lines to the .pro file of the Qt project in which you want to use Qwt plugins
      QWT_LOCATION = /opt/qwt-6.1.0
      INCLUDEPATH += $${QWT_LOCATION}/include/
      LIBS += -L$${QWT_LOCATION}/lib -lqwt@

    4. Done!

  • Moderators

    Hi and welcome to devnet

    Thanks for sharing the information. Actually, it would fit probably very good into the wiki section where "such 'how to' stuff": belongs.

    Please consider copying it to the wiki.

  • Moderators


    Qt creator version is currently V3.0. You mean Qt 5 and Qt 5.1.1, which are the Qt libs you may use for your applications. Qt creator 3.0 is the current version of the IDE which can be used to make your own applications.

  • Thank you very much for the feedback. I'll make the updates.

Log in to reply

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