当前位置: 首页>编程语言>正文

centos8安装gfortran centos8安装gnome

前言

  在服务器CentOs8.2上安装geant4软件,但是运行不起来,所以本节开始主要是安装qt,测试qt基本功能。

 

要点

  添加qt环境到系统环境中,是geant4启动qt的必要条件。

 

下载Qt在线安装程序

  Qt在线安装包下载地址:https://download.qt.io/archive/online_installers/4.3/  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户,第1张

 

安装Qt

步骤一:复制解压改权限

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_02,第2张

步骤二:运行

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_03,第3张

yum install libxcb-devel
export QT_DEBUG_PLUGINS=1
find / -name libxcb-icccm.so.4

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_04,第4张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_05,第5张

  解决一阵,出其他错误,解决不了,暂时不钻了,替换安装版本试一试:

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_普通用户_06,第6张

  替换版本是成功得,但是最后笔者在启动qtcreator还是遇到这个问题,解决方法如下:

yum install xcb-util-image
yum install xcb-util-keysyms

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_普通用户_07,第7张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_08,第8张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_09,第9张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_普通用户_10,第10张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_11,第11张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_12,第12张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_13,第13张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_14,第14张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_15,第15张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_16,第16张

  十几分钟到几十分钟吧,看网络了,最后如下图:

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_17,第17张

步骤三:添加Qt的环境变量

  root用户的配置(仅使用root用户时有效):

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_18,第18张

export QTDIR=/opt/Qt
export PATH=$QTDIR/5.15.2/gcc_64/bin:$QTDIR/Tools/QtCreator/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/5.15.2/gcc_64/lib:$LD_LIBRARY_PATH

  普通用户的配置(仅使用普通用户时生效):

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_19,第19张

export QTDIR=/opt/Qt
export PATH=$QTDIR/5.15.2/gcc_64/bin:$QTDIR/Tools/QtCreator/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/5.15.2/gcc_64/lib:$LD_LIBRARY_PATH

步骤四:测试qmake

  重启,测试普通用户,root用户:

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_20,第20张

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_21,第21张

步骤五:打开qtcreaor

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_普通用户_22,第22张

  直接命令行输入qtcreator,报错缺少“libxcb-icccm.so.4”,安装即可:

yum install xcb-util-wm

  运行出现错误,需要设置下面这个再运行:

export QT_DEBUG_PLUGINS=1

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_23,第23张

  仔细看,发现还是之前换qt在线安装出现的老问题:

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_24,第24张

yum install xcb-util-image

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_Qt_25,第25张

yum install xcb-util-keysyms

  再运行qtcreator即可,如下图:

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_root用户_26,第26张

 

第一个程序“Hello world”

  

centos8安装gfortran centos8安装gnome,centos8安装gfortran centos8安装gnome_centos8安装gfortran_27,第27张




https://www.xamrdz.com/lan/5tt1939457.html

相关文章: