我在 Ubuntu 20.04.6 LTS 上使用 Qt。我收到了有关 Qt 更新的通知,因此我更新了 Qt。之后,每当我尝试打开 Qt Creator 时,都会收到此错误:
from 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform 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: minimalegl, scb, eglfs, minimal, linuxfb, vkkhrdisplay, offscreen, vnc, wayland, wayland-egl.
我尝试卸载并重新安装 Qt,但没有帮助。我还研究了 Stack Overflow 和其他平台上提供的其他问题和答案,但没有一个能解决我的问题。
我试过了:
问题截图:
确保使用以下命令安装 xcb-cursor0 库:
使用以下命令验证您的 Qt 安装:
检查库路径:
重新启动 Qt Creator。如果问题仍然存在,请尝试:
Unable to locate package libxcb-cursor0
如果您在安装时遇到问题,libxcb-cursor0
请尝试libxcb-cursor1
使用sudo apt-get install libxcursor1
. 安装此软件包后,重试步骤以解决 Qt Creator 中的 Qt 平台插件 xcb 问题。如果错误仍然存在,请按照以下步骤操作。在 Ubuntu 20.04 中,libxcb-cursor-dev 软件包在默认存储库中可能不可用。您可以尝试从“universe”存储库安装它。您可以这样做:
完成这些步骤后,尝试再次运行您的应用程序。如果问题仍然存在或遇到任何错误,请告诉我。
确保 Qt 版本与您的系统之间的兼容性。这些步骤应该可以解决问题。