[Solved] XCB error - QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
-
Hi,
I am trying to get working the Cube example from the Qt OpenGL example on my device (linux arm based) but I am getting the following error:
@QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
Segmentation fault@Here my ./configure:
@./configure -prefix /usr/local/qt-embedded-5.4.0 -xplatform linux-arm-gnueabihf-g++ -opensource -release -no-pch -qpa xcb -qreal float -force-pkg-config -skip qtwebkit -skip qtwebkit-examples -skip qtwebchannel -skip qtwebengine -skip qtwayland -v -opengl es2 -no-eglfs -no-largefile -no-dbus -device-option CROSS_COMPILE=/opt/gcc-linaro-arm-linux-gnueabihf-4.8-2014.04_linux/bin/arm-linux-gnueabihf-gcc@And here my build summary:
@Build options:
Configuration .......... accessibility audio-backend c++11 clock-gettime clock-monotonic compile_examples concurrent cross_compile egl evdev eventfd freetype full-config getaddrinfo getifaddrs harfbuzz iconv inotify ipv6ifname large-config linuxfb medium-config minimal-config mremap nis opengl opengles2 pcre png posix_fallocate qpa qpa reduce_exports release rpath shared small-config use_gold_linker xcb xcb-plugin xcb-sm xkbcommon-qt zlib
Build parts ............ libs examples
Mode ................... release
Using C++11 ............ yes
Using gold linker....... yes
Using PCH .............. no
Target compiler supports:
Neon ................. autoQt modules and options:
Qt D-Bus ............... no
Qt Concurrent .......... yes
Qt GUI ................. yes
Qt Widgets ............. yes
Large File ............. no
QML debugging .......... yes
Use system proxies ..... noSupport enabled for:
Accessibility .......... yes
ALSA ................... no
CUPS ................... no
Evdev .................. yes
FontConfig ............. no
FreeType ............... yes (bundled copy)
Glib ................... no
GTK theme .............. no
HarfBuzz ............... yes (bundled copy)
Iconv .................. yes
ICU .................... no
Image formats:
GIF .................. yes (plugin, using bundled copy)
JPEG ................. yes (plugin, using bundled copy)
PNG .................. yes (in QtGui, using bundled copy)
journald ............... no
mtdev .................. no
Networking:
getaddrinfo .......... yes
getifaddrs ........... yes
IPv6 ifname .......... yes
OpenSSL .............. no
NIS .................... yes
OpenGL / OpenVG:
EGL .................. yes
OpenGL ............... yes (OpenGL ES 2.0+)
OpenVG ............... no
PCRE ................... yes (bundled copy)
pkg-config ............. yes
PulseAudio ............. no
QPA backends:
DirectFB ............. no
EGLFS ................ no
KMS .................. no
LinuxFB .............. yes
XCB .................. yes (system library)
EGL on X ........... no
GLX ................ no
MIT-SHM ............ yes
Xcb-Xlib ........... no
Xcursor ............ yes (loaded at runtime)
Xfixes ............. yes (loaded at runtime)
Xi ................. yes (loaded at runtime)
Xi2 ................ no
Xinerama ........... yes (loaded at runtime)
Xrandr ............. yes (loaded at runtime)
Xrender ............ no
XKB ................ no
XShape ............. yes
XSync .............. yes
XVideo ............. yes
Session management ..... yes
SQL drivers:
DB2 .................. no
InterBase ............ no
MySQL ................ no
OCI .................. no
ODBC ................. no
PostgreSQL ........... no
SQLite 2 ............. no
SQLite ............... yes (plugin, using bundled copy)
TDS .................. no
udev ................... no
xkbcommon .............. yes (bundled copy, XKB config root: /usr/share/X11/xkb)
zlib ................... yes (bundled copy)@Does my built Qt correct ? Is the "EGL on X ........... no" related to this error ?
What does it mean to "enable EGL" ? What am I supposed to do ?My host is a virtual machine with Ubuntu 14.04 LTS 64bit and I am using Qt 5.4.0.
Thank you !
-
The EGL on X test fails when the EGL implementation does not support functioning under X11. If "my device (linux arm based)" is a Raspberry Pi then this is expected. There the only way to run OpenGL-based Qt apps is to run them directly on the framebuffer using eglfs. (now, why eglfs is disabled too is another question...)
-
I just had the same issue but on PC desktop. When you run configure script, it runs config.tests, which contain qpa tests. My issue was that due to some unknown issue to compile egl test I needed to manually add wayland libraries for linker. So, how I've done it:
- go to your_qt_path/qtbase/config.tests/qpa/egl
- run "make" if there is a makefile or "cmake && make" if there is not
- see what errors you've got. I had linker errors to unresolved "wl_global_create" and so on. So I opened egl.pro and added "-lwayland-server -lwayland-client" to LIBS+=
- run cmake and make to see if it works.
- if it is, run configure script again and see if there is support for EGL and EGL on X
I don't know why there is a need for wayland. But it worked for me. As far as I remember this is not the first time i've been doing this
Hope this helps
EDIT: My bad, I didn't see that you have EGL support in your summary. Then just see the same way why don't you have support for EGL on X. Just try to compile the test egl-X11
-
Thank you for your answer !
I got it work!!! Basically it was a problem with the @XCB .................. yes (system library)
EGL on X ........... no@
that is supposed to be "yes". Some libraries were missing. Here my steps in case someone needs it:- install libdbus-1-dev on my target => dbus seems to be needed so I removed the -no-dbus from my ./configure
- Copy the libdbus-1.so.3.7.6 on my host and create the links of libdbus-1.so
- Check the configure results to find out which libraries are missing. In my case, I needed to copy from the target to the host the following libraries: libX11-xcb.so.1.0.0 ; libXrender.so.1.3.0 ; libXext.so.6.4.0 and libxcb-render-util.so.0.0.0
I got the cube example working after that!
Thank you !