Important: Please read the Qt Code of Conduct -

Setting up cross compiler (rasp Pi)

  • Hi All,

    I'm having few issues setting up the cross compiler for my raspberry pi. I'm a newbie so bear with me on this :)

    I'm following the guide on :

    in the Compiling qtbase section of this guide once i run the following commands,

    • ./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
      make -j 4
      sudo make install

    '/usr/local/qt5pi' folder want there? (do we expect this folder to be there?). On what location i'm meant to run the commands above? i noticed there is a '/usr/local/qt5pi' on /mnt/raspberry-pi-rootfs too may be thats where i'm going wrong.

    Could someone kindly help me on this. I've been working on this for a week now.

    Any help is appreciated.

    Thank you,

  • Lifetime Qt Champion


    Yes it's a folder as good as any, but with this naming it's clear what it is. It will contain the host tools that will be used to setup/handle your cross-compiled Qt. The one on the remote will contain the cross-compiled libraries that will be used to run your applications.

  • @SGaist thank you very much for your clarification..

    So it appears the host folder is missing. Do I simply clone the folder from /mnt/raspberry-pi-rootfps to the host workstation?

    Thank you

  • Lifetime Qt Champion

    No, it should be created when you call make install

  • @SGaist hmm.. That's what I'm trying to figure out. The host folder isn't there even though it's specified in the config script. Not sure what I'm don g wrong here.

    Thank you for your help sofar

  • Lifetime Qt Champion

    Got any error message when calling make install ?

  • @SGaist Hi I'm sorry about the delayed response.

    I re-ran the config just to make sure whether there are any errors.I didn’t notice any. I ran config, make, sudo make install all three on ~/Qt/5.5/Src$ and still i cant see /usr/local/qt5pi created?

    Not sure what im doing wrong here. My home folder is encrypted (if that makes any diffrence). i thought running sudo make install enable to create folders on root?

    I'm really frustrated with this issue, any help is appreciated,

    Thank you very much for your help so far.

  • Lifetime Qt Champion

    When calling configure again, did you do it on a clean tree ?

  • @newpi

    The compiled files will be on the mounted sd card image. You set qt creator to use those files when configuring.
    The only downside to this is that you need to mount that image every time you want to cross compile.
    I just made a script to mount the img then open qt creator and it gets me back to where I was.

  • @SGaist Hi No i ran it on ~/Qt/5.5/Src$

  • Lifetime Qt Champion

    When you re-call configure you must do it on a clean tree otherwise you might have problems

Log in to reply