首先安装好QT在第一次测试的时候发现程序编译成功但是无法正常运行,报错:
系统:ubuntu22.04
QT:6.4
```bash
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
libxcb-xinerama.so.0: cannot open shared object file: No such file or directory
首先,学会定位错误
在bashrc中加入
export QT_DEBUG_PLUGINS=1
然后找到qt编译好的程序用命令行运行,即显示调试信息,阅读调试信息发现xcb已经安装成功但是xcb有一依赖项未安装。
通过搜索定位包libxcb-cursor0
运行
sudo apt install libxcb-cursor0
完美解决