Qt5 cross-compile issues

  • Qt & Linux novice here trying to get Qt5 on a Pi3 for a learning project. I've been following the instructions on https://wiki.qt.io/RaspberryPi_Beginners_Guide using a VMWare image running Ubuntu 16.04.1. Pi image used is 2017-01-11-raspbian-jessie.img, toolchain gcc-4.7-linaro-rpi-gnueabihf.

    I got everything working up to "make -j 4" which takes a long time and spits out a whole lot of output, but eventually ends in:

    make[2]: Leaving directory '/home/cmatthews/opt/qt5/qtbase/src/gui'
    make[1]: Leaving directory '/home/cmatthews/opt/qt5/qtbase/src'
    Makefile:46: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2

    The /usr/local/qt5pi/bin folder is created, but no qmake.

    Departures I had to take from the instructions as written, that might have inadvertantly contributed to my errors:

    The commands:

    cd ~/opt/cross-compile-tools
    sudo ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs/ ~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc

    This threw an error that I was giving too many arguments. Looking at fixQualifiedLibraryPaths, yes, there's no way that command would work:

    if [ "$#" -ne 1 ]; then
        echo "usage ./cmd target-rootfs"
        exit -1
    #passed args

    I made an assumption that this script changed at some point and used to accept TOOLCHAIN as a passed argument. I changed the last line to:


    And then just used this command:

    sudo ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs/

    That seemed to work and let me get on to the configure step. I entered, exactly as written in the instructions:

    ./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

    When I first tried this I was getting "error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory". Googling this I did an apt-get install lib32stdc++6 and that cleared the problem up.

    Can anyone help w/ this?

  • @ackum You'll have to show us the actual error. You just showed the end of the make output that shows it failed but doesn't show the error.

    Run just make without the extra jobs so the error doesn't get lost easily and either paste the relevant error parts or you could put up the whole make output on pastebin or something.

    Grab make output by running:
    make &> output

    Then you can upload that output file, or look through it at your leisure.

  • @ambershark OK, I did as you asked and here is the resulting output:

    https://www.dropbox.com/s/z6vrffh2shvgeym/error log.txt?dl=0

  • Fixed this issue myself. Took some crash course learning but I realized fixQualfiedLibraryPaths in the cross compile repo in the aforementioned Raspberry Pi Beginners Guide, just don't work. Running this, it wasn't fixing any symlinks at all, and I was not sophisiticated enough to understand it wasn't doing anything...

    In an older Qt support forum post https://forum.qt.io/topic/51542/qt-5-4-compile-problem-for-raspberry-pi-again/8 Someone had some similiar problems and the fixQualifiedLibraryPaths script in that post was different. I copied & ran that script instead and it worked. I was able to run make & install after that with no errors.

Log in to reply