Compiling QT on windows for cross compilation with raspberry, fails. Project ERROR: Cannot run target compiler



  • Hello,

    I am running windows on my computer, trying to build QT 5.10.1 for cross compilation on my Raspberry Pi Zero Wireless.

    I am trying to follow the tutorial here: https://wiki.qt.io/RaspberryPi2EGLFS

    I came all the way until step 10, and stuck there.

    Running the following command:

    configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=C:/qt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot C:/qt/raspi/sysroot -no-use-gold-linker -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix C:/qt/raspi/qt5pi -hostprefix C:/qt/raspi/qt5 -v
    

    the output is:

    C:\qt\raspi\qtbase>configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=C:/qt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot C:/qt/raspi/sysroot -no-use-gold-linker -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix C:/qt/raspi/qt5pi -hostprefix C:/qt/raspi/qt5 -v
    Running syncqt ...
    <srcbase> = C:/qt/raspi/qtbase
    <outbase> = C:/qt/raspi/qtbase
    Bootstrapping qmake ...
    mingw32-make: Nothing to be done for 'first'.
    Command line: -release -opengl es2 -device linux-rasp-pi3-g++ -device-option "CROSS_COMPILE=C:/qt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-" -sysroot C:/qt/raspi/sysroot -no-use-gold-linker -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix C:/qt/raspi/qt5pi -hostprefix C:/qt/raspi/qt5 -v
    Project ERROR: Cannot run target compiler 'C:/qt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++'. Output:
    ===================
    'C:/qt/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++' is not recognized as an internal or external command,
    operable program or batch file.
    ===================
    Maybe you forgot to setup the environment?
    

    I checked, and the file exists but windows doesnt let me to run it this way. any help appreciated.

    Thanks in advance.


  • Moderators

    @cskr You compiler executable looks like the one for Linux. Is it possible you installed Linux tool chain on your Windows? The link you posted describes how to do it on Linux. I highly recommend to do cross compilation on Linux (can be a virtual machine) instead on Windows - it is way easier.



  • @jsulm thank you for your help.

    I set up a virtual box ubuntu, and followed the same tutorial. And I am stuck at the same step.

    I run the command:

    ./configure -release -opengl es2 -device linux-rasp-pi3-g++ -no-use-gold-linker -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
    

    The end of the output is:

    Info: creating cache file /home/sakir/qtbase/.qmake.cache
    Command line: -release -opengl es2 -device linux-rasp-pi3-g++ -no-use-gold-linker -device-option CROSS_COMPILE=/home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- -sysroot /home/sakir/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /home/sakir/raspi/qt5pi -hostprefix /home/sakir/raspi/qt5 -v
    Project ERROR: Cannot run target compiler '/home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++'. Output:
    ===================
    sh: 1: /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-g++: not found
    ===================
    Maybe you forgot to setup the environment?
    
    

    The file exists, I made sure of it.

    0_1519308252592_ss.png

    I tried the clean command and run it again. It didn't work. I tried to run the same command with sudo, it didn't work.

    Is the tutorial missing a step? What am I doing wrong?



  • All right, I managed to overcome that error by changing to x64 compiler. But that command still does not work.

    My config.log is as follows:

    Command line: -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=/home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot /home/sakir/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix /home/sakir/raspi/qt5pi -hostprefix /home/sakir/raspi/qt5 -v -no-use-gold-linker
    executing config test machineTuple
    + /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -dumpmachine
    > arm-linux-gnueabihf
    test config.qtbase.tests.machineTuple succeeded
    executing config test verifyspec
    + cd /home/sakir/qtbase/config.tests/verifyspec && /home/sakir/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/home/sakir/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/sakir/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/sakir/raspi/sysroot" -early "CONFIG += cross_compile" /home/sakir/qtbase/config.tests/verifyspec
    > Info: creating stash file /home/sakir/qtbase/config.tests/.qmake.stash
    + cd /home/sakir/qtbase/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make
    > /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/sakir/raspi/sysroot -O2 -std=gnu++11 -w -fPIC  -I. -I/home/sakir/qtbase/mkspecs/devices/linux-rasp-pi3-g++ -o verifyspec.o verifyspec.cpp
    > /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/sakir/raspi/sysroot -Wl,-O1 -Wl,-rpath-link,/home/sakir/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/sakir/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/sakir/raspi/sysroot/lib/arm-linux-gnueabihf -o verifyspec verifyspec.o    
    > /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
    > /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
    > /home/sakir/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
    > collect2: error: ld returned 1 exit status
    > Makefile:66: recipe for target 'verifyspec' failed
    > make: *** [verifyspec] Error 1
    

    Any help appreciated. Thanks in advance.


  • Moderators



  • @cskr
    Hello, Did you find any solution for this problem???



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