首页 > 解决方案 > Rapsbian 和 Qt5

问题描述

我正在 Raspberry Pi 3 上使用 qt5.11 开发应用程序。我的代码在我的笔记本电脑上运行 ubuntu 18.xx。当我将代码放在 RPi 上时,我可以使用 Makefile 对其进行编译,make -j2但是当我想启动我的程序时,我会收到以下消息:

16:02:44: Starting /home/pi/build-VideoProcessor-Desktop-Debug/VideoProcessor...
**libEGL warning: DRI2: failed to authenticate**
**qt5ct: using qt5ct plugin**

(VideoProcessor:985): GLib-GObject-WARNING **: 16:02:55.208: cannot register existing type 'GtkWidget'
(VideoProcessor:985): GLib-GObject-CRITICAL **: 16:02:55.208: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(VideoProcessor:985): GLib-GObject-WARNING **: 16:02:55.208: cannot register existing type 'GtkBuildable'
(VideoProcessor:985): GLib-GObject-CRITICAL **: 16:02:55.208: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
(VideoProcessor:985): GLib-CRITICAL **: 16:02:55.208: g_once_init_leave: assertion 'result != 0' failed
(VideoProcessor:985): GLib-GObject-CRITICAL **: 16:02:55.208: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
(VideoProcessor:985): GLib-GObject-CRITICAL **: 16:02:55.208: g_type_register_static: assertion 'parent_type > 0' failed

我不明白我的 RPi 发生了什么,因为我的代码适用于我的笔记本电脑。

标签: qtraspberry-piqt5

解决方案


我相信这个问题是因为你没有启用 OpenGL 支持。

跑:

sudo raspi-config

然后选择:

Advanced Options
GL Driver
GL (Fake KMS)

重启后应该可以正常工作。

这将消除此错误:libEGL 警告:DRI2:身份验证失败。


推荐阅读