zoukankan      html  css  js  c++  java
  • qt 5.1.1 on CentOS 6.4

    Overview

    If you are trying to install Qt and Qwt [qwt.sourceforge.net] (Qt Widgets for Technical Applications) on CentOS, then the following instructions should be of good use. These steps were created, after many a trial and error, using Qt 5.1.1 and Qwt 6.1.0 on CentOS 6.4 ×86 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

    1. sudo yum groupinstall "Development Tools"

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

    1. sudo yum install glibc-devel.i686

    3. Download and install GCC [gcc.gnu.org] 4.8.1 or latest version. Instructions copied from here [gcc.gnu.org]

    1. tar xvjf gcc-4.8.1.tar.bz2
    2. cd gcc-4.8.1
    3. ./contrib/download_prerequisites
    4. cd ..
    5. mkdir objdir
    6. cd objdir
    7. $PWD/../gcc-4.8.1/configure --prefix=$HOME/gcc-4.8.1
    8. make
    9. sudo make install

    4. Copy new GCC libraries to /usr/lib64

    1. sudo mv /usr/lib64/libstdc++.so.6 /usr/lib64/libstdc++.so.6.backup
    2. sudo cp -P /opt/gcc-4.8.1/lib64/libstdc++.so.6 /usr/lib64
    3. sudo cp /opt/gcc-4.8.1/lib64/libstdc++.so.6.0.18 /usr/lib64/
    4. sudo ldconfig -v

    5. Download and install Qt [qt-project.org] 5.1.1 or latest version

    1. sudo ./qt-linux-opensource-5.1.1-x86_64-offline.run

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

    • Create qt5.sh file
      1. sudo gedit /etc/profile.d/qt5.sh
    • Add the following lines to qt5.sh
      1. PATH=/opt/Qt5.1.1/5.1.1/gcc_64/bin:$PATH
      2. export PATH
    • Save and close qt5.sh
    • Run qt5.sh
      1. . /etc/profile.d/qt5.sh
    • Verify that qmake is version 5.1.1
      1. which qmake

    7. Edit Qt Creator desktop configuration file to allow all users to run

    1. 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

    1. sudo yum install mesa-libGLU-devel

    2. Download and install Qwt [qwt.sourceforge.net] 6.1.0 or latest version

    1. tar xvjf qwt-6.1.0.tar.bz2
    2. cd qwt-6.1.0
    • Configure qwtconfig.pri
      1. 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
      1. qmake qwt.pro
      2. make
      3. sudo make install

    3. Link Qwt plugin to Qt

    1. sudo ln -s /opt/qwt-6.1.0/plugins/designer/libqwt_designer_plugin.so /opt/Qt5.1.1/Tools/QtCreator/bin/plugins/designer/

    4. Create qwt ld.so configuration file

    1. echo /opt/qwt-6.1.0/lib | sudo tee /etc/ld.so.conf.d/qwt.conf
    2. sudo ldconfig -v

    5. Add the following lines to the .pro file of the Qt project in which you want to use Qwt plugins

    1. #QWT
    2. QWT_LOCATION = /opt/qwt-6.1.0
    3. INCLUDEPATH += $${QWT_LOCATION}/include/
    4. LIBS += -L$${QWT_LOCATION}/lib -lqwt

    6. Done!

  • 相关阅读:
    Js获取当前浏览器的高和宽度
    js中使用键盘键,每个键的值
    网络搜索之实现网络蜘蛛
    进程和线程
    jquery.bgiframe.js在IE9下的错误
    [习题]GridView样版内部,改用CheckBox/Radio/DropDownList(单/复选)控件,取代TextBox
    [入门]C#语法里面,如何使用 VB的常用函数?(using Microsoft.VisualBasic)
    [全文下载/试读]补充,上集Ch. 3 Panel控件与常用属性,范例:问卷系统,动态产生「子问题」(使用障眼法)
    [ASP.NET] 上课 第一天的简介
    TextBox的 TextChanged事件#1 动态给予默认值,会触发TextChanged事件吗? / #2 EnableViewState属性是做什么用?
  • 原文地址:https://www.cnblogs.com/ruiy/p/4310723.html
Copyright © 2011-2022 走看看