Linux下安装Qt6的问题及解决

  1. Linux下安装完Qt6,新建Qt/QtQuick CMake工程编译出现如下错误:
Found package configuration file: Qt6Config.cmake but it set Qt6 FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find required Qt componen "Quick".

这是因为系统中缺少OpenGL库,可以安装libgl1-mesa-dev

sudo apt install libgl1-mesa-dev

如果出现E: Package 'libgl1-mesa-dev' has no installation candidate,可以添加 main repository到apt,执行update后再安装。

sudo add-apt-repository main
sudo apt update
  1. 项目编译成功后运行,如果出现如下错误
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even through it was found.
Available platform plugins are: eglfs, wayland-egl, vkkhrdisplay, linuxfb, minimal, xcb, offscreen, minimalegl, vnc.

可以通过安装 libxcb 解决: sudo apt install libxcb-cursor*

posted @   jigsawecho  阅读(1009)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
点击右上角即可分享
微信分享提示