I'm writing a program that with Qt5 opengl context. It works well on my desktop (fedora 23). But i have to run it on the pi 2. So i download Qt5 every where source code and compiled it natively on the pi. When i tried to compile and run my program on the pi it throws following error:
QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled
In Qt forums i saw that in Raspberry pi XCB cant integrate with egl in anyway. Also when i was configuring Qt source codes the EGL on x option was no. But GLX was enabled. Is there anyway to set QXcbIntegration to use GLX on the pi?
I was trying to fix XCB and egl integration. So i tried to recompile egl-x11 test in config.tests/qpa directory of qtbase to see the errors. Output was:
g++ -c -pipe -O2 -Wall -W -fPIC -I. -isystem /usr/include/libdrm -I../../../mkspecs/linux-g++ -o egl-x11.o egl-x11.cpp
egl-x11.cpp: In function ‘int main(int, char**)’:
egl-x11.cpp:47:20: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
egl-x11.cpp:49:11: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
egl-x11.cpp:50:79: error: invalid conversion from ‘Window {aka long unsigned int}’ to ‘EGLNativeWindowType {aka void*}’ [-fpermissive]
egl-x11.cpp:51:26: error: invalid conversion from ‘EGLNativeWindowType {aka void*}’ to ‘Window {aka long unsigned int}’ [-fpermissive]
/usr/include/X11/Xlib.h:2251:12: error: initializing argument 2 of ‘int XDestroyWindow(Display*, Window)’ [-fpermissive]
Makefile:530: recipe for target 'egl-x11.o' failed
make: *** [egl-x11.o] Error 1
Is there any way to fix the XCB and EGL integration?
If neither EGL nor GLX integration is possible on raspberry pi what can i do to run my application on the pi?