Important: Please read the Qt Code of Conduct -

[TUTO] Build Qt to cross compile for arm

  • Yes I am, wow I am an idiot.
    If I try to use a qt 4 example should it work?

  • So I am using the proper example now, it compiles, but when I run the make It says:

    make: Nothing to be done for 'first'.

    I have attached the entire command and response below:

    sam@sam-VirtualBox:~/Downloads$ "/home/sam/Downloads/qt-everywhere-opensource-src-4.8.5/bin/qmake" '/home/sam/classwizard/' -r CONFIG+=debug -spec /home/sam/Downloads/qt-everywhere-opensource-src-4.8.5/mkspecs/qws/linux-arm-gnueabi-g++
    sam@sam-VirtualBox:~/Downloads$ make
    make: Nothing to be done for `first'.

  • Lifetime Qt Champion

    Did you cross-compile Qt ? If so did you install it ?

  • I thought I built it for ARM and it would just run on its own.
    Do I need Qt installed on my ARM hardware?
    When I move the folder to my ARM hardware I get this error when I try to run it:
    ./classwizard: undefined symbol: _ZN7QWidget8qwsEventEP8QSEvent

  • Lifetime Qt Champion

    Looks like you cross-compiled your application with Qt 4 and try to run it against Qt 5.

  • I have Qt 4 on my arm device, but I am still getting the same error. Not sure what to do here?
    I have Qt 4 on Raspbian on a Raspberry Pi 3 model B.
    Not sure why this error keeps coming up.

  • Lifetime Qt Champion

    Because the Qt 4 you have installed with Raspbian is a standard Qt build for ARM not a Qt for embedded device build.

    You have have to cross-compile your Qt 4 again without the embedded option.

  • But the Qt I have on my linux where I built the project is for ARM. Its the one for this project.
    So should I just use the build from this post on my pi?

  • Lifetime Qt Champion

    I didn't say the contrary: both builds are valid. The one you have on your desktop machine is a Qt For Embedded Linux build which uses QWS while on your Raspbian you have a standard as in "desktop standard" build of Qt 4.

    It depends on how you want to use your application on your Pi. If its the QWS functionality that you need then you have to install your self-built Qt 4 on the Pi.

  • What if I just created a deb package on my Linux machine, and then used that on the Pi?
    Or is it better to just do the custom build? (really dont want to do that painful process)
    Is this a guide I can use as a base for this build?:

  • So I managed to compile and run a Hello World project. Creating the make and executable on my Linux with this ARM build. Then moving it onto the Pi and running it. But when I try anything more complex I am getting the same error.

  • Lifetime Qt Champion

    Again: this is an Qt for Embedded Linux build see the -embedded arm configure option. Thus my question, are you going to use the X Server of your Pi ?

    If yes, you have to rebuild Qt without the embedded options but keep the ARM target.

    If no, then one basic option is to copy the content of the cross-compiled Qt installation folder over to your Pi at the same place and you should be good to go (you can later remove stuff like the host tools headers etc.)

  • How can I do this compilation with opengl?

  • Lifetime Qt Champion

    Which version of Qt are you currently using ?

  • Execute this command to install Qt in the /usr/local/Qt-4.8.5-arm/ directory : ./configure -opensource -confirm-license -prefix /usr/local/Qt-4.8.5-arm -embedded arm -little-endian -no-pch -xplatform qws/linux-arm-gnueabi-g++

    In this step Did you create /usr/local/Qt-4.8.5-arm/ directory ? or Did created by qt creator when installitaion?

  • This post is deleted!

  • Hi,

    I am not understood that fourth step,

    Go to /home/<yourUserName>/
    Execute this command to install Qt in the /usr/local/Qt-4.8.5-arm/ directory : ./configure -opensource -confirm-license -prefix /usr/local/Qt-4.8.5-arm -embedded arm -little-endian -no-pch -xplatform qws/linux-arm-gnueabi-g++

    why beacuse,when i go /home/<username> there is no such file called (this present in installQt directory) and in /usr/local also not present the Qt-4.8.5

    anyone help how to processed next..

  • Lifetime Qt Champion

    @asha You should not copy the steps exactly, you have to adapt them to your environment:
    Go to /home/<yourUserName>/ - this means go to your home directory
    Qt-4.8.5 - change that to the Qt version you want to compile.

  • Sir,

    I have uninstalled everything(which means cross compiler and my first qt version)

    now i followed the steps,as said in above..

    so now I am not getting where to execute.

    can I execute where i am getting the configure file.

  • Lifetime Qt Champion

    @asha said in [TUTO] Build Qt to cross compile for arm:

    so now I am not getting where to execute

    execute what? configure?
    "can I execute where i am getting the configure file" - configure file is part of Qt source code. So, download Qt source code, extract it to a directory, go to that directory and execute configure there...

  • Hi,
    I execute the configure file,as you can see here


    After this Executed the make,the result is:


    so what that error says?how to solve this..

  • Hi,

    Any suggestions,

  • Lifetime Qt Champion

    @asha Please show how you call configure.
    Also, it is better to post text instead of screen-shots...

  • I called configure
    0_1568359047816_calling configure.png .

  • @jsulm sorry,ffor some of the reason using screenshots.

  • Hi,

    Can anyone say,

    what it does: fourth step

    ."/configure -opensource -confirm-license -prefix /usr/local/Qt-4.8.5-arm -embedded arm -little-endian -no-pch -xplatform qws/linux-arm-gnueabi-g++"

    specially this part "embedded arm -little-endian -no-pch -xplatform qws/linux-arm-gnueabi-g++"


    I downloaded qt src code 5.7.1 and arm-linux-gnueabihf-gcc 6.5.0, and I found my qmake.conf file in "/home/<username>/Downloads/qt-everywhere-opensource-src-5.7.1/qtbase/mkspecs/linux-arm-gnueabi-g++"

    So,now I need to configure,not getting the above path,I don't have qws directory,

    can I give just ./configure for configuration?

  • @Asha
    Same problem.