[Solved] Cross Compile Issue

  • All,

    I am trying to cross compile Qt 5 for the Rpi and have followed the "Beginners Guide to Cross Compile Qt5 on a RaspberryPi" posted here, with the execption of also having installed the packages in "Native Build of Qt 5 on a Raspberry Pi" that were listed as "needed for compiling." I can get it to configure fine, but when I try to make qtbase I get the following output:
    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]
    In file included from qxcbconnection.cpp:72:0:
    /mnt/rasp-pi-rootfs/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]
    In file included from qxcbconnection.cpp:72:0:
    /mnt/rasp-pi-rootfs/usr/include/X11/Xlib-xcb.h:16:6: error: initializing argument 1 of ‘void XSetEventQueueOwner(Display*, XEventQueueOwner)’ [-fpermissive]
    /home/charles/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/rasp-pi-rootfs -O2 -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_MTDEV -DQT_NO_XKB -DQ_FONTCONFIGDATABASE -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../../../../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/mnt/rasp-pi-rootfs/opt/vc/include -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vcos/pthreads -I/mnt/rasp-pi-rootfs/opt/vc/include/interface/vmcs_host/linux -o .obj/qlinuxfbscreen.o qlinuxfbscreen.cpp
    make[5]: *** [.obj/qxcbconnection.o] Error 1
    make[5]: Leaving directory /home/charles/opt/qt5/qtbase/src/plugins/platforms/xcb' make[4]: *** [sub-xcb-plugin-pro-make_first-ordered] Error 2 make[4]: Leaving directory/home/charles/opt/qt5/qtbase/src/plugins/platforms/xcb'
    make[3]: *** [sub-xcb-make_first] Error 2
    make[3]: *** Waiting for unfinished jobs....

    This had worked fine in December, but due to some hardware problems I am forced to redo it.

    Any assistance is appricated.


  • I am trying to compile Qt for Tegra and I am getting the same error. I was managed to compile it in November 2013 without problems. It seems that this is a new issue. Any help is highly appreciated.


    P.S.: I did use the qxcbconnection.cpp before updates in December 2013 and the compilation seems fine. However, I haven't tested if Qt is working or not.


  • Moderators

    Welcome to devnet for both of you

    I have added "code tags":http://qt-project.org/wiki/ForumHelp#e3f82045ad0f480d3fb9e0ac2d58fb01 to the first post. This makes reading a bit easier also for error output.

    Are you aware of the "Qt's bug tracker JIRA?":https://bugreports.qt-project.org/secure/Dashboard.jspa
    If it is a new or an old bug, you may some information in there. Furthermore, since may be a new bug you can report it there. There are some Qt development folks also in this forum, but it is not generally scanned for possible bug reports. So, you information may get lost when only reported here.

  • Crt - thanks for letting me know I'm not the only one with this.

    koahnig - thanks for fixing the formatting. I wasn't aware of the bug tracker. I have reported it here:


  • Moderators

    You are welcome.

    Thanks for sharing here the link to your bug report. This gives others the possibility to vote for the bug report and, therefore, increasing its importance.

  • I'm getting the same error (compiling for Tegra).

    Did anybody manage to overcome this (simple quickfix)?

  • I'm currently attempting to build Qt on the Raspberry Pi itself, and I'll post if that works. Also, I noticed that a previous version of Qt5 that I successfully cross-compiled previously no longer does, and those files haven't been updated. That one is on a Linux Mint system, so I wonder if Debian/Ubuntu/Linux Mint has patched a file that may be causing a conflict. I'm going to try to revert to an older version of Linux Mint and see if it works, but I won't be able to try that for a couple of days.

  • Update - the native compile failed for the same reason, as well as the cross-compilation using the older version of Linux Mint.

  • Also, whiteRabbit,

    Simple fix is to revert your local qt5 repository to a version before the file was updated. If your on Linux, gitk is a useful utility to do this.

  • My solution didn't work. For those who don't want to check out the bug report, this is whats happened:

    "EGL and GLES are not supported with xcb on the Pi (since the EGL implementation is not X compatible). For getting GL the only option is to use eglfs. If this is sufficient, building xcb is not necessary in the first place and it is better to pass -no-xcb to configure to skip building this plugin altogether.

    If GL is not desired and the goal is only to run widget (no Qt Quick, no OpenGL) apps under X, try configuring with -no-opengl. This should avoid the build issues since the EGL code path is skipped completely.

  • This is now corrected in 5.3. It will be possible to build the xcb plugin on the Pi (without OpenGL support of course).

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.