【TOOLS】ubuntu如何安装QtCreator

2 篇文章 0 订阅

1. 准备工作

首先去QT官网下载安装包,我这里选择的是在线安装,路径如下:https://download.qt.io/archive/online_installers/4.1/
在这里插入图片描述
将下载好的安装包存放在ubuntu上:
在这里插入图片描述
添加可执行的权限,并启动安装:

chmod +x qt-unified-linux-x86_64-4.1.1-online.run
sudo ./qt-unified-linux-x86_64-4.1.1-online.run

2. 详细安装步骤

执行qt-unified-linux-x86_64-4.1.1-online.run安装文件:

输入QT的账号密码:

勾选之后下一步:

等待加载完成:

勾选之后下一步:

设置安装路径,并且选择客制化安装:

选择安装的QT工具版本,因为我的ARM板的QT环境是Qt 5.15.2,所以我这里选择了该版本。我只选择了Qt 5.15.2的部分功能,可以全部勾选,可能安装时间会长点。

勾选之后下一步:

选择install进行安装:

正在安装中,等待完成:

到这里说明QtCreator已经按照完成,点击Finish完成安装:

3. 验证QtCreator

在搜索栏中,输入qt可以看到QtCreator图标,然后点击启动:

成功打开QtCreator工具,如下图:

新建一个项目,可以正常显示Hello World!!!,如下:

4. 安装过程中遇到的问题

  • 问题1:QtCreator无法正常被打开
    为了调试方便,我们找到安装路径下的qt 手动执行 qtcreator:

    打印错误log如下:
    qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
    
    Aborted (core dumped)
    

    解决办法:

    sudo apt-get install libxcb-xinerama0
    
  • 问题2:QtCreator编译时报错

    打印的错误log:
    /usr/bin/ld: cannot find -lGL
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:264: hello001] Error 1
    16:18:50: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project hello001 (kit: Desktop Qt 5.15.2 GCC 64bit)
    When executing step "Make"
    

    解决办法:

    sudo apt-get install libgl1-mesa-dev
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值