为什么Qt平台插件“xcb”无法加载,即使它已被找到?

4

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

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

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.

有人经历过这个问题吗?我可以尝试什么来解决它?

1个回答

1
因为无法连接到显示器,所以加载失败。如果这是远程的话,你是否使用了带有X转发的SSH?你需要类似这样的东西。
或者,您想在RPi上显示,那么问题就是缺少环境变量。在常规shell会话中使用printenv查看。将DISPLAY、XAUTHORITY和其他任何看起来合适的内容复制到您的远程调试会话中。

我没有使用X转发。应用程序显示在目标上。只有文本(标准输出和标准错误输出,我猜)在我的开发机器上显示。 - rrd
你能具体说明我需要哪些环境变量以及我应该如何处理它们吗?我不知道将这些变量复制到我的远程调试会话中意味着什么。 - rrd

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接