Important: Please read the Qt Code of Conduct -

Cross-Compiling Qt 5.12 for Raspberry Pi Fails

  • Hello,

    I am trying to cross-compile Qt 5.12 from git, and failing. This works for other Qt versions (tested with 5.9.x, 5.10.x and 5.11.x, up to 5.11.3), but it does not work for Qt 5.12.

    So here is what i do, basically:

    git clone git://
    cd qt5
    git checkout 5.12.0
    perl init-repository

    The configure string i am currently using (and working up to Qt 5.11.3) is:

    ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=(...)/arm-linux-gnueabihf- -sysroot SYSROOT -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix (...)/qt5pi -hostprefix (...)/qt5 -no-use-gold-linker -no-gbm -skip qtscript -skip qtwebengine -skip qtwayland -skip qtlocation -v

    The configure step goes as expected. Then, when i try the make step... The following happens:

    cd qtbase/ && ( test -e Makefile || ~/qt5/qtbase/bin/qmake -o Makefile ~/qt5/qtbase/ ) && make -f Makefile 
    Info: creating cache file ~/qt5/qtbase/.qmake.cache
    make[1]: Entering directory '~/qt5/qtbase'
    cd src/ && ( test -e Makefile || ~/qt5/qtbase/bin/qmake -o Makefile ~/qt5/qtbase/src/ ) && make -f Makefile 
    make[2]: Entering directory '~/qt5/qtbase/src'
    cd corelib/ && ( test -e Makefile.qtzlib || ~/qt5/qtbase/bin/qmake -o Makefile.qtzlib ~/qt5/qtbase/src/corelib/ ) && make -f Makefile.qtzlib 
    Project MESSAGE: ~/qt5/bin/syncqt -module QtZlib -version 5.12.0 -outdir ~/qt5 -builddir ~/qt5/qtbase ~/qt5/qtbase
    sh: 1: ~/qt5/bin/syncqt: not found
    Project ERROR: Failed to run: ~/qt5/bin/syncqt -module QtZlib -version 5.12.0 -outdir ~/qt5 -builddir ~/qt5/qtbase ~/qt5/qtbase
    Makefile:73: recipe for target 'sub-zlib-make_first' failed
    make[2]: *** [sub-zlib-make_first] Error 3
    make[2]: Leaving directory '~/qt5/qtbase/src'
    Makefile:50: recipe for target 'sub-src-make_first' failed
    make[1]: *** [sub-src-make_first] Error 2
    make[1]: Leaving directory '~/qt5/qtbase'
    Makefile:86: recipe for target 'module-qtbase-make_first' failed
    make: *** [module-qtbase-make_first] Error 2

    As far as I can tell, the make command is looking for the folder "qt5/bin/syncqt", but it does not exist. What exists is "qt5/qtbase/bin/syncqt". I don't know if this is an issue or not.

    If i try the configure command INSIDE the qtbase folder, only to build qtbase, it also works fine, the configure command goes fine, and the make command goes fine... But i am unable to build all the Qt modules at once due to this...

    If i try these steps on Qt 5.11.3, it works, and builds ok, the make command goes to the end fine.

    Thanks a lot.

  • Qt Champions 2019

    @CarlosMesquita said in Cross-Compiling Qt 5.12 for Raspberry Pi Fails:

    -sysroot SYSROOT

    This doesn't look correct. Where is your sysroot?

  • @jsulm said in Cross-Compiling Qt 5.12 for Raspberry Pi Fails:

    @CarlosMesquita said in Cross-Compiling Qt 5.12 for Raspberry Pi Fails:

    -sysroot SYSROOT

    This doesn't look correct. Where is your sysroot?

    Sure it doesn't hehe
    I replaced some parts for other strings in order to keep the commands shorter. My sysroot is something like:

    -sysroot ~/carlos/rpi_cctools_test/sysroot

  • So, i got some updates on this issue.

    When using branches 5.12.0 OR 5.12.1, the issue is the one reported above.

    But if i use branch(or tag, i dunno) 5.12, and using the very same configure string command, i get the following error message when running the configure:

    ERROR: Feature 'opengles2' was enabled, but the pre-condition 'config.win32 || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed.
    ERROR: The OpenGL functionality tests failed!
    You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
    QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

    Any thoughts?

  • Is this last issue related to EGL libraries? I renamed how they are referenced in ./qtbase/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf, maybe this help.

    Have a look at the steps I followed to cross compile Qt 5.12, particulary section “6. Configure Qt for cross compilation“ from

Log in to reply