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
成功编译运行:



