栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

Ubuntu20.04安装Qt开发环境编译运行程序

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Ubuntu20.04安装Qt开发环境编译运行程序

项目场景:

Ubuntu20.04安装Qt,创建项目,编译运行

根据需要下载适合版本的Qt在线安装器: 清华大学镜像库





问题描述

Qt安装器无法双击启动

解决方案:

修改文件属性:


问题描述

qt安装后新建项目,却无法编译项目:


原因分析:

缺少C++环境:


解决方案:

安装C++环境:

sudo apt-get install g++

问题描述

安装C++环境后进行编译,有报错:
12:29:17: Could not start process “make” -f /home/linasi/build-untitled-Desktop_Qt_5_15_2_GCC_64bit-Debug/Makefile qmake_all.
Error while building/deploying project untitled (kit: Desktop Qt 5.15.2 GCC 64bit)
When executing step “qmake”

解决办法:
sudo apt-get install build-essential

问题描述

/usr/bin/ld: cannot find -lGL
collect2: error: ld returned 1 exit status
make: *** [Makefile:282: untitled] Error 1
12:36:26: 进程"/usr/bin/make"退出,退出代码 2 。
Error while building/deploying project untitled (kit: Desktop Qt 5.15.2 GCC 64bit)
When executing step “Make”

解决办法:
sudo apt-get install libgl1-mesa-dev

问题描述

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, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

解决办法:
sudo apt-get install libxcb-xinerama0

成功编译运行:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/997467.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号