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!

qt 5.1.1 on CentOS 6.4的更多相关文章

  1. Hadoop生态圈-离线方式部署Cloudera Manager5.15.1

    Hadoop生态圈-离线方式部署Cloudera Manager5.15.1 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 到目前位置,Cloudera Manager和CDH最新 ...

  2. 几个比較好的IT站和开发库官网

    几个比較好的IT站和开发库官网 1.IT技术.项目类站点 (1)首推CodeProject,一个国外的IT站点,官网地址为:http://www.codeproject.com,这个站点为程序开发人员 ...

  3. Linux基础命令-查看基本硬件信息

    Linux基础命令-查看基本硬件信息 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看CPU信息 [root@node101.yinzhengjie.org.cn ~]# l ...

  4. 几个比较好的IT站和开发库官网

    1.IT技术.项目类网站 (1)首推CodeProject,一个国外的IT网站,官网地址为:http://www.codeproject.com,这个网站为程序开发者提供了很好的代码示例以及讲解,不过 ...

  5. centos 下 Qt Creator 的安装使用

    centos 下 Qt Creator 的安装使用 Qt 以其开源,免费,完全面向对象(很容易扩展),允许真正的组件编程以及可移植跨平台等诸多优势得到越来越多的开发人员的青睐.Qt Creator 是 ...

  6. 在CentOS下面编译WizNote Qt Project

    编译环境 CentOS 64位 Desktop 版本:6.5 编译前的准备: CentOS的用户默认没有root权限,如果当前用户没有权限root,则可以在终端里面执行下面的命令: su root s ...

  7. CentOS下Qt窗口透明效果失效,成黑色背景的问题

    一.问题 Linux系统下Qt窗口的透明效果成了黑色,但同样的代码在windows机子上有透明效果,主要是修改系统的配置,仅在centos6.3及其以上版本实验过.其他系统可以相应配置. 二.问题运行 ...

  8. Qt for Linux:环境搭建(CentOS 6.5 32位)——完全从零安装

    正文开始前,我们假设,用户可以操作终端 拥有root权限,以下所有操作也均由root完成 可以上网 安装了CentOS 6.5 32位 注:红色部分,每个人可能都不一样 话不多说,列出本章大致流程 1 ...

  9. centos 下Qt安装 mysql驱动(亲测可行)

    (前半部分没有试过,因为我的有mysql驱动,实在抱歉) 1.预防万一,先安装一下mysql-devel(一定要装!). 不安装的话后面编译会出现找不到-lmysqlclient的问题. 2. 开始编 ...

随机推荐

  1. JQuery DataTables Editor---只修改页面内容

    近来在工作中需要对JQuery DataTables进行增,删,改的操作,在网上找了一些资料,感觉比较的好的就是(http://editor.datatables.net/)文章中所展示的操作方法(如 ...

  2. WPF按钮清空自带样式,以及透明按钮时,Grid的Background属性设置引起"点击"问题.

    1.空样式按钮 <Style x:Key="EmptyButtonStyle" TargetType="Button">            &l ...

  3. WebMatrix安装和使用

    官网:http://www.microsoft.com/web/webmatrix/ 一直觉得dreamweaver已经过时了,很多新的库都不支持.而且,启动慢,占用内存多,是时候换一个ide了. h ...

  4. react-native学习笔记——ViewStack组件

    今天来写一个组件,相信很多人都会用到的——ViewStack. ViewStack组件无疑是UI中很重要的一个组件,可惜react-native并没有内嵌进去,需要开发者自己去实现. 实现原理很简单, ...

  5. rootvg 镜像

    具体操作步骤如下 : a)        查看一下当前可用的硬盘: # lspv hdisk0          0002d74f0e69d97a                    rootvg ...

  6. #include <fstream>

    1 fstream 2 ifstream 3 ofstream 4 seekg 5 seekp 6 tellg 7 tellp 1 fstream 打开输入输出文件流 #include <ios ...

  7. 网易云课堂_程序设计入门-C语言_第六章:数组_2鞍点

    2 鞍点(5分) 题目内容: 给定一个n*n矩阵A.矩阵A的鞍点是一个位置(i,j),在该位置上的元素是第i行上的最大数,第j列上的最小数.一个矩阵A也可能没有鞍点. 你的任务是找出A的鞍点. 输入格 ...

  8. string和整数转换

    tostring(int) fromstring(string ) c++11新方式 stod Convert string to double (function template ) stold ...

  9. 9款极具创意的HTML5/CSS3进度条动画(免积分下载)

    尊重原创,原文地址:http://www.cnblogs.com/html5tricks/p/3622918.html 免积分打包下载地址:http://download.csdn.net/detai ...

  10. .NET程序员生活开始

    不知不觉,开始踏入程序员生活了!加油吧.有关Session的好文章: 最近这两天被一个Web Farm环境下的Session处理问题虐得很痛苦,网上到处找解决方案,在无意中翻看到这篇文章,感觉很不错, ...