Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Raspberry Pi toolchain on Ubuntu 16.04



  • Hello all,

    I have issues creating a tool-chain for cross compiling Raspberry Pi 3 Qt applications through Ubuntu. I used directions from this guide, https://wiki.qt.io/Raspberry_Pi_Beginners_Guide, to help me create the tool-chain. Currently, I am stuck on this step in the section Compiling qtbase in the guide:

    ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
    

    The error I receive is the following in terminal:

    sudo ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/rasp-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -hostprefix /usr/local/qt5pi
    <srcbase> = /home/ubuntu16/opt/qt5/qtbase 
    <bldbase> = /home/ubuntu16/opt/qt5/qtbase 
    <outbase> = /home/ubuntu16/opt/qt5/qtbase 
    Creating qmake...
    .Done.
    Project ERROR: Cannot run target compiler '/home/ubuntu16/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++'. Output:
    ===================
    ===================
    Maybe you forgot to setup the environment?
    

    I am new Qt and have beginners understanding of Ubuntu. I am currently running Ubuntu 16.04 64-bit on within VirtualBox. How do I setup the environment? Should I have the Raspberry Pi 3 connected to my PC via SSH?

    Thank you for any help. Best,
    P. Keshavarzi



  • @pkeshavarzi said in Raspberry Pi toolchain on Ubuntu 16.04:

    CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-

    This value must point to where you have downloaded/unpacked the cross-compiling toolchain. From the guide you referenced:

     Download the cross compiling toolchain:
    

    wget https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz
    (or at http://de.sourceforge.jp/projects/sfnet_rfidmonitor/downloads/crosscompilation-resources/gcc-4.7-linaro-rpi-gnueabihf.tbz)
    tar -xf gcc-4.7-linaro-rpi-gnueabihf.tbz

    Please use the location where you unpacked the toolchain tarball



  • @Pablo-J.-Rogina Hey Pablo, Thanks for the reply. I double checked the unpacked tarball and it exists within in the folder. So do all the files that will be used. What else do you recommend to get past this?

    Best,
    P. Keshavarzi


  • Lifetime Qt Champion

    @pkeshavarzi What happens if you call

    /home/ubuntu16/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -v
    

    ?



  • @jsulm I just tried to run that in the terminal:

    ubuntu16@ubuntu16-VirtualBox:~/opt/qt5/qtbase$ sudo /home/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -v
    bash: /home/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++: No such file or directory
    

    The error says no file or directory. However, when I check the folder, it shows that it's there:

    0_1556027801280_e1e0b217-15f4-40b1-9991-b97c7606ad65-image.png

    Does this mean there is a problem with the 'symbolic links' from the earlier step of the guide? Another possibility and kind of a stupid question: Even though I ran with super user permissions, maybe there is an issue with permissions for the folder and it's contents?



  • @pkeshavarzi from command line, could you please do:

    ls -la /home/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++
    


  • @Pablo-J.-Rogina said in Raspberry Pi toolchain on Ubuntu 16.04:

    gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++

    I just ran the command and received the message from terminal 'No such file or directory':

    ubuntu16@ubuntu16-VirtualBox:~$ ls -la /home/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++
    ls: cannot access '/home/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++': No such file or directory
    


  • @pkeshavarzi it looks like you're messing up the folders, one example shows /home/ubuntu16/opt/... and then you also use /home/opt/...

    Anyway, what if you do:

    sudo find / -name arm-linux-gnueabihf-g++
    

Log in to reply