Important: Please read the Qt Code of Conduct -

Cross Compile Qt for RPI on OSX

  • Hello,
    I was trying to cross compile qt to use with RPI on OSX but I can't do ./configure as said on the tutorial:

    Joses-MacBook-Pro:qtbase ze$ ./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
    This is the Qt Open Source Edition.
    You are licensed to use this software under the terms of
    the Lesser GNU General Public License (LGPL) versions 2.1.
    You are also licensed to use this software under the terms of
    the GNU Lesser General Public License (LGPL) versions 3.
    You have already accepted the terms of the Open Source license.
    ./configure: line 3416: /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
    Precompiled-headers support disabled.
    /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
    /Users/ze/raspi/qtbase/config.tests/unix/fvisibility.test: line 29: /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
    Symbol visibility control disabled.
    ./configure: line 360: /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
    ./configure: line 360: /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
    /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ --sysroot=/Users/ze/raspi/sysroot -o -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
    /Users/ze/raspi/qtbase/config.tests/unix/bsymbolic_functions.test: line 18: /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: cannot execute binary file
    Symbolic function binding disabled.
    <srcbase> = /Users/ze/raspi/qtbase 
    <outbase> = /Users/ze/raspi/qtbase 
    Creating qmake...
    make: Nothing to be done for `first'.
    Running configuration tests...
    Determining architecture... ()
    /Users/ze/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/

  • Lifetime Qt Champion


    Your cross-compiler is not built for OS X but for Linux. You have two options:

    1. Use a Linux Virtual machine using e.g. Virtual Box
    2. Find a cross-compiler for OS X. You can try this one

  • @SGaist said:

    this one

    Thank you,
    I'll try!

  • Hi, please take a look to this how-to:

    It could be helpful for you.

Log in to reply