Error when cross compiling Qt 5.0.1 for the Raspberry Pi



  • I'm trying to cross compile Qt 5.0.1 (latest release at the moment) for my Raspberry Pi. My set up is as follows:

    Operating System: Ubuntu 12.04 32-bit

    Cross compiler: Built from crosstool-NG program, using the exact instructions "found here":http://www.bootc.net/archives/2012/05/26/how-to-build-a-cross-compiler-for-your-raspberry-pi/

    Raspberry Pi Operating System: Raspbian Wheezy 2013-02-09 (mounted at /mnt/raspberry-pi-rootfs)

    Configure command:
    @./configure -no-pch -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=/home/<myusername>/x-tools/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi- -sysroot /mnt/raspberry-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5-raspberry-pi -v@

    When I run the configure command, it always fails with the following error:

    @Could not determine the target architecture!@
    @/mnt/raspberry-pi-rootfs/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory@
    

    Anyone know what this means?

    I have tried the latest pre-built Linaro Toolchain cross compiler "from here":https://wiki.linaro.org/WorkingGroups/ToolChain, and Qt at least builds, but any program compiled with it causes SIGILL (illegal instruction) fault as soon as the program runs up, which I guess is because the pre-built cross compler I used is not targeting the right architecture.

    Note:

    I am aware cross compiling is fiendishly difficult, but I'd like to understand more about what is going on.

    I have seen demonstrations of people cross compiling Qt 5 applications for Raspberry Pi, so I know it is possible, it is very frustrating to not be able to do it myself.

    Does anyone have a working setup for cross compiling Qt 5 for Raspberry Pi?



  • I've used "this guide":http://qt-project.org/wiki/RaspberryPi_Beginners_guide twice with minor mistakes (mine).

    But it's working.


Log in to reply
 

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