How To Install Qt 5.6.3 In Centos 6

Centos 6 Install Qt 5.6.3

How To Install Qt 5.6.3 In Centos 6

Why choose Qt 5.6

Qt 5.6 is a relatively compromised version. Many new features of Qt 5 are already available (such as QWebEngine). Too high versions require manual compilation of GCC, Glibc, Xorg and many other related environments on Centos 6, which is very cumbersome.

Download Qt 5.6

The official download link for Qt5.6 has been removed, and now only long-term support and recent versions can be downloaded from the official.

Centos 6 Install Qt 5.6.3

File Parameters Parameter Values
File name qt-opensource-linux-x64-5.6.3.run
File Size 680MB
File Format Qt Linux Installer
Download Github
Download Tools No special designation
Download link qt-opensource-linux-x64-5.6.3.run

Install Qt 5.6

  1. Give file executable permissions

    # chmod 755 qt-opensource-linux-x64-5.6.3.run
  2. Run the file to complete the installation

    # ./qt-opensource-linux-x64-5.6.3.run
  3. Adding environment variables

    • create a new qt5.sh file:
      # vim /etc/profile.d/qt5.sh
    • Add the following:
      export PATH="/opt/Qt5.6.3/5.6.3/gcc_64/bin:$PATH"
      export PATH="/opt/Qt5.6.3/Tools/QtCreator/bin:$PATH"
    • :wq save and exit
    • Make it effective:
      # source /etc/profile
    • Check if the settings take effect
      # which qmake
      /opt/Qt5.6.3/5.6.3/gcc_64/bin/qmake

Upgrade GCC

  1. Why need to upgrade GCC?
    Official support documentation from Qt 5.6
    https://doc.qt.io/archives/qt-5.6/supported-platforms.html
    It can be seen that Qt 5.6 requires at least GCC 4.9.1 support (many new features cannot be used without upgrading, and some Qt Demo also failed to compile), I choose to install GCC8 here.
    Centos 6 Install Qt 5.6.3

  2. Install GCC8 with SCL Repo

    # yum -y install centos-release-scl
    # yum -y install devtoolset-8-gcc devtoolset-8-gcc-c++ devtoolset-8-binutils
    # scl enable devtoolset-8 bash  #启动gcc8
    # echo "source /opt/rh/devtoolset-8/enable" >>/etc/profile
    # source /etc/profile
  3. Verify the installation

    # gcc -v
    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-8/root/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
    Target: x86_64-redhat-linux
    Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-8/root/usr --mandir=/opt/rh/devtoolset-8/root/usr/share/man --infodir=/opt/rh/devtoolset-8/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-8.3.1-20190311/obj-x86_64-redhat-linux/isl-install --disable-libmpx --with-mpc=/builddir/build/BUILD/gcc-8.3.1-20190311/obj-x86_64-redhat-linux/mpc-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
    Thread model: posix
    gcc version 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)

Configure qtcreator

  1. Tools -> Options -> Build & Run -> Compilers -> Add -> GCC, Compiler path points to the g++ path in the Qt installation directory
    Centos 6 Install Qt 5.6.3

  2. Kits -> Add, Select the Compiler we just created
    Centos 6 Install Qt 5.6.3

Tested on Qt 5.6.3

I chose the QWebEngine demo demobrowser, and we can see that everything compiles and runs properly!
Centos 6 Install Qt 5.6.3

0 0 votes
Article Rating
赞(0) 打赏
未经允许不得转载:iemblog » How To Install Qt 5.6.3 In Centos 6
Subscribe
Notify of
guest

0 COMMENTS
Inline Feedbacks
View all comments
免责声明:本站大部分下载资源收集于网络,只做学习和交流使用,版权归原作者所有,请在下载后24小时之内自觉删除,若作商业用途,请购买正版,由于未及时购买和付费发生的侵权行为,与本站无关。本站发布的内容若侵犯到您的权益,请联系站长删除,我们将及时处理! Disclaimer: Most of the download resources on this site are collected on the Internet, and are only used for learning and communication. The copyright belongs to the original author. Please consciously delete within 24 hours after downloading. If you use it for commercial purposes, please purchase the original version. If the content posted on this site violates your rights, please contact us to delete it, and we will deal with it in time!

联系我们 Contact us

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏

0
Would love your thoughts, please comment.x
()
x