【问题标题】:Why Qt plaftorm plugin "xcb" cannot be loaded even though it was found?为什么即使找到了 Qt 平台插件“xcb”也无法加载?
【发布时间】:2019-10-09 02:43:25
【问题描述】:

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

当我从 RPi 终端使用 ./app -platform xcb 之类的命令运行我的 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.

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

【问题讨论】:

    标签: linux qt raspberry-pi cross-compiling xcb


    【解决方案1】:

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

    或者您希望在 RPi 上显示,那么问题是缺少环境变量。查看使用 printenv 的常规 shell 会话。将 DISPLAY、XAUTHORITY 和其他任何看起来可能进入远程调试会话的内容。

    【讨论】:

    • 我没有使用 X 转发。应用程序显示在目标上。只是文本(我猜是标准输出和标准错误)显示在我的开发机器上。
    • 您能否准确地说出我需要哪些环境变量以及我应该如何处理它们?我不知道将变量复制到我的远程调试会话意味着什么。
    猜你喜欢
    • 2022-07-25
    • 2021-09-03
    • 2016-01-08
    • 2020-05-05
    • 1970-01-01
    • 1970-01-01
    • 2019-12-13
    • 2015-08-06
    • 1970-01-01
    相关资源
    最近更新 更多