linux - 为什么Qt平台插件 "xcb"找到了却无法加载?

标签 linux qt raspberry-pi cross-compiling xcb

我在笔记本电脑上交叉编译了 Qt5.12,并将其安装在运行 Raspbian Stretch OS 的 Raspberry Pi 3 上。我正在尝试远程调试(从 QtCreator)在 RPi 上运行的应用程序。

当我使用像 ./app -platform xcb 这样的命令从 RPi 终端运行我的 Qt 应用程序时,它工作正常,但是当我尝试从远程调试 session 运行相同的应用程序时,我得到了以下输出:

Could not load shared library symbols for /usr/local/qt5pi/plugins/platforms/libqxcb.so.
Do you need "set solib-search-path" or "set sysroot"?qt.qpa.xcb: could not connect to display 
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "/usr/local/qt5pi/plugins/platforms" 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 (from /usr/local/qt5pi/plugins/platforms), 
linuxfb (from /usr/local/qt5pi/plugins/platforms), 
minimal (from /usr/local/qt5pi/plugins/platforms), 
minimalegl (from /usr/local/qt5pi/plugins/platforms), 
offscreen (from /usr/local/qt5pi/plugins/platforms), 
vnc (from /usr/local/qt5pi/plugins/platforms), 
webgl (from /usr/local/qt5pi/plugins/platforms), 
xcb (from /usr/local/qt5pi/plugins/platforms), 
eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl, xcb.

有人遇到过这种情况吗?我可以尝试解决这个问题吗?

最佳答案

加载失败,因为它无法连接到显示器。如果这是远程的,如您所说,您是否使用带 X 转发的 SSH?你会需要这样的东西。

或者您想要在 RPi 上显示,那么问题是缺少环境变量。使用 printenv 查看常规 shell session 。将 DISPLAY、XAUTHORITY 和任何其他看起来可能的内容复制到您的远程调试 session 中。

关于linux - 为什么Qt平台插件 "xcb"找到了却无法加载?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56259725/

相关文章:

linux - 将终端显示的输出写入文件中

c++ - 本地存储QML,获取Sqlite数据库位置

python - Raspberry Pi 湿度传感器未定义引用 'pinMode' 等

linux - 如何在 Linux 上将 Raspberry Pi 的 I2C 时钟配置为 100K

raspberry-pi - FFI 在 Racket 中具有依赖关系?

c - 高性能阅读 - linux/pthreads

linux - 权限被拒绝但在服务器上添加了公钥?

c++ - 查看是否安装了adb

linux - 在 shell 中读取命令

c++ - QTabWidget 选项卡上下文菜单