Important: Please read the Qt Code of Conduct -

QT 5.2 Raspberry Compile

  • Hello all,

    i tried to compile qt 5.2 on the raspberry. But i get alwasy follow error. My last try was to add -qt-xcb on the configure flags.

    Is there any solution for the problem?

    /usr/bin/g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DXCB_USE_XLIB -DXCB_USE_XINPUT2 -DXCB_USE_EGL -DSUPPORT_X11 -DXCB_USE_RENDER -DDFLT_XKB_CONFIG_ROOT="/usr/share/X11/xkb" -DDEFAULT_XKB_RULES="evdev" -DDEFAULT_XKB_MODEL="pc105" -DDEFAULT_XKB_LAYOUT="us" -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_PLUGIN -DQT_PLATFORMSUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../mkspecs/devices/linux-rasp-pi-g++ -I. -I../../../3rdparty/xcb/include -I../../../3rdparty/xcb/sysinclude -I../../../3rdparty/xkbcommon -I../../../3rdparty/xkbcommon/src -I../../../3rdparty/xkbcommon/src/xkbcomp -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -I../../../../include -I../../../../include/QtPlatformSupport -I../../../../include/QtPlatformSupport/5.2.2 -I../../../../include/QtPlatformSupport/5.2.2/QtPlatformSupport -I../../../../include/QtGui/5.2.2 -I../../../../include/QtGui/5.2.2/QtGui -I../../../../include/QtCore/5.2.2 -I../../../../include/QtCore/5.2.2/QtCore -I../../../../include/QtGui -I../../../../include/QtCore -I.moc -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -o .obj/qxcbconnection.o qxcbconnection.cpp
    qxcbconnection.cpp: In constructor ‘QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, const char*)’:
    qxcbconnection.cpp:280:45: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
    /usr/include/X11/Xlib-xcb.h:13:19: error: initializing argument 1 of ‘xcb_connection_t* XGetXCBConnection(Display*)’ [-fpermissive]
    qxcbconnection.cpp:281:51: error: invalid conversion from ‘EGLNativeDisplayType {aka void*}’ to ‘Display* {aka _XDisplay*}’ [-fpermissive]
    /usr/include/X11/Xlib-xcb.h:16:6: error: initializing argument 1 of ‘void XSetEventQueueOwner(Display*, XEventQueueOwner)’ [-fpermissive]
    make[6]: *** [.obj/qxcbconnection.o] Error 1
    make[6]: Leaving directory /home/pi/opt/qt5/qtbase/src/plugins/platforms/xcb' make[5]: *** [sub-xcb-plugin-pro-make_first-ordered] Error 2 make[5]: Leaving directory/home/pi/opt/qt5/qtbase/src/plugins/platforms/xcb'
    make[4]: *** [sub-xcb-make_first] Error 2
    make[4]: Leaving directory /home/pi/opt/qt5/qtbase/src/plugins/platforms' make[3]: *** [sub-platforms-make_first] Error 2 make[3]: Leaving directory/home/pi/opt/qt5/qtbase/src/plugins'
    make[2]: *** [sub-plugins-make_first] Error 2
    make[2]: Leaving directory /home/pi/opt/qt5/qtbase/src' make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory/home/pi/opt/qt5/qtbase'
    make: *** [module-qtbase-make_first] Error 2


  • no one has a idea ?

  • You can try to set compiler flags with "-fpermissive" .

  • The EGL implementation is not compatible with X. You should build with -no-xcb and use the eglfs platform plugin. This way you will be using EGL/GLES directly, bypassing X entirely.

  • I success build with -no-xcb on Raspberry Pi.
    but examples/multimediawidgets/camera
    *CameraBin error: "Could not initialise X output"

    Any help would be appreciated!
    sorry for my english.

  • By passing -no-xcb you have disabled X support in your build of Qt. Therefore applications that require X for some reason will not work. I am not familiar with the multimedia stuff, though, so I am not quite sure why X is a requirement there and if the camera example is supposed to work on the Pi or not.

    Sidenote: In 5.3 we have fixed the xcb plugin so that it will once again compile on the Pi but only without EGL and OpenGL support. See

  • Thanks for agocs.
    But I still have question.
    Raspberry Pi's OS is Raspbian.
    Raspbian are X11 desktop platforms.
    I can install opengl on Raspbian(apt-get install libglu1-mesa-dev).

    When I ./configure,
    Why can not -qt-xcb? Instead -eglfs.

    sorry for my english.

  • Because there is no hardware accelerated X on the Pi.

    Also, you cannot "install OpenGL on Raspbian", you are merely installing the GLU headers and libraries with that command which is irrelevant.

  • OK,I understand.
    Thanks again.

Log in to reply