QXcbIntegration:无法创建平台OpenGL上下文

时间:2017-12-03 05:40:16

标签: qt5 yocto

我一直试图在Raspberry Pi 3上使用Yocto的Poky Pyro为core-image-sato图片添加Qt5支持。

在我的bblayer.conf中,我添加了这些行:

BBLAYERS ?= " \
        /poky-pyro/meta \
        /poky-pyro/meta-poky \
        /poky-pyro/meta-yocto-bsp \
        /poky-pyro/meta-openembedded/meta-oe \
        /poky-pyro/meta-openembedded/meta-multimedia \
        /poky-pyro/meta-openembedded/meta-networking \
        /poky-pyro/meta-openembedded/meta-perl \
        /poky-pyro/meta-openembedded/meta-python \
        /poky-pyro/meta-raspberrypi \
        /poky-pyro/meta-qt5 \
  "

在我的local.conf中,我添加了这些行:

DISTRO_FEATURES_append = " opengl "
IMAGE_INSTALL_append = " qtbase qtdeclarative qtquickcontrols2 qtmultimedia qttools cinematicexperience "

Bitbake成功构建了图像,但是当我在目标上运行Qt5_cenimaticExperience时,我收到此错误消息:

QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled.

1 个答案:

答案 0 :(得分:0)

这是Qtbase的默认配置,并根据您拥有的内容:

PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'gl', '', d)}"
PACKAGECONFIG_DEFAULT ?= "dbus udev evdev widgets tools libs freetype tests"
PACKAGECONFIG_SYSTEM ?= "jpeg libpng zlib"

如您所见,我们只启用了-opengl desktop;我们需要的是嵌入式系统的opengl es2

要更正此问题,请将此行添加到local.conf

PACKAGECONFIG_append_pn-qtbase = " gles2 "

顺便说一句,这是我的qtbase配置:

PACKAGECONFIG_append_pn-qtbase = " gles2 fontconfig \
                gstreamer \
                accessibility \
                tslib examples \
                "