我在 Ubuntu 20.04.6 LTS 上使用 Qt。我收到了有关 Qt 更新的通知,因此我更新了 Qt。之后,每当我尝试打开 Qt Creator 时,都会收到此错误:
\nfrom 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. \nCould not load the Qt platform plugin "xcb" in "" even though it was found.\nThis application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.\n\nAvailable platform plugins are: minimalegl, scb, eglfs, minimal, linuxfb, vkkhrdisplay, offscreen, vnc, wayland, wayland-egl.\nRun Code Online (Sandbox Code Playgroud)\n我尝试卸载并重新安装 Qt,但没有帮助。我还研究了 Stack Overflow 和其他平台上提供的其他问题和答案,但没有一个能解决我的问题。
\n我试过了:
\n问题截图:
\n\nBug*_*der 11
确保使用以下命令安装 xcb-cursor0 库:
sudo apt-get install libxcb-cursor0
Run Code Online (Sandbox Code Playgroud)
使用以下命令验证您的 Qt 安装:
sudo apt-get install --reinstall qt5-default
Run Code Online (Sandbox Code Playgroud)
检查库路径:
export LD_LIBRARY_PATH=/path/to/libxcb-cursor0:$LD_LIBRARY_PATH
Run Code Online (Sandbox Code Playgroud)
重新启动 Qt Creator。如果问题仍然存在,请尝试:
qtcreator -reconfigure
Run Code Online (Sandbox Code Playgroud)
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”存储库安装它。您可以这样做:
sudo add-apt-repository universe
sudo apt-get update
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install libxcb-cursor-dev
Run Code Online (Sandbox Code Playgroud)
sudo apt-get install libxcb-cursor0
Run Code Online (Sandbox Code Playgroud)
完成这些步骤后,尝试再次运行您的应用程序。如果问题仍然存在或遇到任何错误,请告诉我。
确保 Qt 版本与您的系统之间的兼容性。这些步骤应该可以解决问题。