Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE



  • I am installing to cross compile from raspberry to ubuntu 64bit.
    However, the following error occurred while attempting make.
    The error below is interpreted as translator, so there may be errors.
    //error contetns..
    Cd qtbase / && (test -e Makefile || /root/Qt/5.4/Src/qtbase/bin/qmake/root/Qt/5.4/Src/qtbase/qtbase.pro -o Makefile) && make -f Makefile
    Make [1]: enter directory '/root/Qt/5.4/Src/qtbase'
    /opt/Qt/5.4/Src/qtbase/bin/qmake -o Makefile qtbase.pro
    Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE = <path>
    Could not read qmake configuration file /root/Qt/5.4/Src/qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf.
    Error processing project file: qtbase.pro
    Makefile: 175: Command to 'Makefile' target failed
    Make [1]: *** [Makefile] error 3
    Make [1]: Exits directory '/root/Qt/5.4/Src/qtbase'
    Makefile: 68: 'module-qtbase-make_first' Command to target failed
    Make: *** [module-qtbase-make_first] Error 2

    Can you help me?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Please show the configuration options you passed



  • @SGaist Could you elaborate for me?
    What configuration options are you referring to?



  • @SGaist I am trying crosscompile with qt5.4 in raspberry pie.
    This is an error that occurred while executing the following command on ubuntu pc.
    ///////////////////////////////////////////////////////////////////////

    sudo apt-get upgrade
    
    sudo apt-get update
    
    sudo apt-get install libgl1-mesa-dev
    
    sudo apt-get build-dep qt5-default
    
    sudo apt-get install libxcb-xinerama0-dev
    
    sudo apt-add-repository ppa:u-szeged/sedkit
    
    sudo apt-get update
    
    sudo apt-get install sedkit-env-qtwebkit
    
    sudo apt-get install build-essential perl python git
    
    sudo apt-get install “^libxcb.*” libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev
    
    sudo apt-get install flex bison gperf libicu-dev libxslt-dev ruby
    
    sudo apt-get install libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev libcap-dev libxtst-dev libpulse-dev libudev-dev libpci-dev libnss3-dev libasound2-dev libxss-dev libegl1-mesa-dev gperf bison
    
    sudo apt-get install libbz2-dev libgcrypt11-dev libdrm-dev libcups2-dev libatkmm-1.6-dev
    
    sudo apt-get install libasound2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
    
    mkdir ~/crosscompile-tools
    
    cd ~/crosscompile-tools
    
    git clone https://github.com/raspberrypi/tools.git
    
    Cd tools
    
    wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
    
    chmod +x sysroot-relativelinks.py./sysroot-relativelinks.py
    
    cd cross-compile-tools
    
    sudo apt-get install lib32z1
    
    https://www.raspberrypi.org/downloads/raspbian/
    
    /mnt/rasp-pi-rootfs
    
    sudo mkdir /mnt/rasp-pi-rootfs
    
    fdisk -l raspbian.img
    
    sudo mount raspbian.img -o loop,offset=$(( 512 * 137216)) /mnt/rasp-pi-rootfs/
    
    sudo ./sysroot-relativelinks.py /mnt/rasp-pi-rootfs
    
    ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs ~/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
    
    export RPI_SYSROOT=/mnt/rasp-pi-rootfs
    
    export RPI_TOOLCHAIN=~/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
    
    cd ~/QT/
    
    ls
    
    cd 5.4
    
    cd Src
    
    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit
    
    sudo make
    

    ////////////////////////////////////////////////////////////////

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit
    

    The command succeeded as the picture.

    ![alt text](0_1496620568567_스크린샷, 2017-06-05 08-52-16.png image url)

    It is an error when executing the next command sudo make command.
    I cross-compiled with reference to this homepage.
    https://medium.com/@amirmann/how-to-cross-compile-qt-for-raspberry-pi-3-on-linux-ubuntu-for-beginners-75acf2a078c


  • Lifetime Qt Champion

    Are you sure you did the export properly for RPI_TOOLCHAIN ?

    The image upload is currently broken. Please take a look at this thread for alternatives..



  • This post is deleted!


  • @SGaist I will show you all the commands I have installed and the results.
    I would be grateful if you could tell me where and what I did wrong.
    mkdir ~/crosscompile-tools

    cd ~/crosscompile-tools
    
    git clone https://github.com/raspberrypi/tools.git
    
    cd tools
    

    ![alt text](0_1496896982684_1.png image url)

    wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
    
    chmod +x sysroot-relativelinks.py./sysroot-relativelinks.py
    

    ![alt text](0_1496896970866_2.png image url)

    and,
    I got an error in the above command, and I ran arbitrarily with the following command.

    chmod +x sysroot-relativelinks.py
    

    ![alt text](0_1496896941843_3.png image url)

    Command was executed.
    I do not know if this is correct.
    Is this part wrong?

    I then ran the following commands.

    cd cross-compile-tools
    sudo apt-get install lib32z1
    

    The cross-compile-tools folder is not created, so I created it myself and ran the following command 'sudo apt-get install lib32z1'
    Are you sure this is wrong?

    ![alt text](0_1496896922430_4.png image url)

    https://www.raspberrypi.org/downloads/raspbian/
    

    Raspbian.img I installed and unzipped the image and ran mount as below.

    /mnt/rasp-pi-rootfs
    
    sudo mkdir /mnt/rasp-pi-rootfs
    
    fdisk -l raspbian.img
    
    sudo mount raspbian.img -o loop,offset=$(( 512 * 137216)) /mnt/rasp-pi-rootfs/
    

    I got the following results.

    ![alt text](0_1496896906163_5.png image url)

    ![alt text](0_1496896885154_6.png image url)

    sudo ./sysroot-relativelinks.py /mnt/rasp-pi-rootfs
    
    ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs ~/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc
    

    ![alt text](0_1496896873690_7.png image url)

    It takes a few seconds to execute the command, but I have already done so, and I have returned the results immediately.
    Are you sure this is wrong?

    export RPI_SYSROOT=/mnt/rasp-pi-rootfs
    
    export RPI_TOOLCHAIN=~/crosscompile-tools/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
    

    ![alt text](0_1496896850729_8.png image url)

    cd /opt/Qt/5.4
    
    ls
    
    cd Src
    

    ![alt text](0_1496896835387_9.png image url)

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit
    

    ![alt text](0_1496896682310_new3.png image url)
    sudo make

    Sudo make will also display the following error:

    ![alt text](0_1496891975515_new1.png image url)

    Please help me,
    Please tell me where and how it went wrong and how to solve it

    But how do you upload the pictures?
    Did my picture upload well?



  • This post is deleted!

Log in to reply
 

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