Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. [TUTO] Build Qt to cross compile for arm

[TUTO] Build Qt to cross compile for arm

Scheduled Pinned Locked Moved Mobile and Embedded
armcross compilecross platformlinux
68 Posts 15 Posters 50.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    koahnig
    wrote on last edited by
    #2

    Hi and welcome

    thanks for sharing. I think that would still go into the wiki section.

    Vote the answer(s) that helped you to solve your issue(s)

    S 1 Reply Last reply
    0
    • W Offline
      W Offline
      wowy
      wrote on last edited by wowy
      #3

      Hello (ou plutôt bonjour ;) )

      After QT is configured, installed, everything is configured in QT creator and i make an application.
      Can i simply copy/paste it in the bin folder of my embedded device or must i copy first some libraries or others stuff on the device ? I tried your tuto and had no problem (aside from a very slow "make"...). I went in QT creator and created a single QT widget application (a window with a button launching a message box), it built in the release folder. But when trying to run it on my board with a ./nameofthefile (and with chmod 755 it) i have an error "applet not found" which make me think either i am missing things on my board or i needed to add somethign to the configuration.

      Still thank you for this help !

      S 1 Reply Last reply
      0
      • W wowy

        Hello (ou plutôt bonjour ;) )

        After QT is configured, installed, everything is configured in QT creator and i make an application.
        Can i simply copy/paste it in the bin folder of my embedded device or must i copy first some libraries or others stuff on the device ? I tried your tuto and had no problem (aside from a very slow "make"...). I went in QT creator and created a single QT widget application (a window with a button launching a message box), it built in the release folder. But when trying to run it on my board with a ./nameofthefile (and with chmod 755 it) i have an error "applet not found" which make me think either i am missing things on my board or i needed to add somethign to the configuration.

        Still thank you for this help !

        S Offline
        S Offline
        Spader42
        wrote on last edited by Spader42
        #4

        @wowy
        Hello

        In my case after compiling the app, i copied it on my pcDuino, I didn't have the same problem than you but another one, i've no interface, my application is started ( a tcpclient that connect to a tcpserver over internet ) i receive it's connection on the PC that run the tcp server. But at the launch of the app it prints me two things, the first one libicui18n.so.48 cannot open shared object file no such file or directory and another one releving to DBUS.

        EDIT : Those problems don't come from a bad compilation but from the pcDuino itself, don't worry this tuto is functionnal.

        I'm sorry i can't help you on that point, and i'll only can get back to work on the pcDuino by monday or tuesday next week to solve these 2 problems.

        I only can advice you to google the message the executable prints you.
        I've made a quick research online for you, it seems to be some problem with the PATH or with some links, i'm sorry i can't help on that, i'll edit my main post by next week with my solution for the pcDuino problems.

        Hope you'll find a solution asap.

        Au revoir ;)

        1 Reply Last reply
        0
        • K koahnig

          Hi and welcome

          thanks for sharing. I think that would still go into the wiki section.

          S Offline
          S Offline
          Spader42
          wrote on last edited by
          #5

          @koahnig Thank you for the fast answer, it's my pleisure to share that little tuto.
          By the way should I move it to the wiki section ?

          1 Reply Last reply
          0
          • S Spader42

            Hi there, i didn't know where to post that, so i post it here. For a few days now i've been trying to build Qt from source to cross compile my apps for an arm architecture ( pcduino for me ). I've not find a lot of help online, so as i've finally managed to cross compile my qt projects, i've decided to post online what i've done.

            I advice you to create a folder where you'll place everything you'll download below, I created the folder /home/<yourUserName>/installQt/

            First : Download qt-sdk

            I've used the 4.8.5 verson of Qt ( i've never tried with another version it might not function the same way )
            You can download it here : QT 4.8.5
            Or use : wget -c http://download.qt.io/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
            Once it's downloaded, extract it.
            You can use this to uncompress your tar.gz : tar xzvf qt-everywhere-opensource-src-4.8.5.tar.gz

            Second : Download the ARM compiler

            You can download it here : ARM Compiler
            Or do just like before : wget -c https://launchpadlibrarian.net/155358238/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
            As you did with the Qt archive you can uncompress it with : tar xJf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz

            At this step you're supposed to have two folder in your installQt directory :

            • qt-everywhere-opensource-src-4.8.5
            • gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux

            You can check the compiler by doing /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc --version

            It should print you something like that :

            arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 (prerelease)
            Copyright © 2013 Free Software Foundation, Inc.
            Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

            I guess it adapts itself to your PC's langage, you should get something like that but in your langage.

            Third : Adapt the qmake.conf file of the qt-sqk you've downloaded

            Modify the file /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
            You can do it with your favorite text editor, for example : vi /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
            The not modified version should looks like this :

            ######################QMAKE.CONF####################
            #
            # qmake configuration for building with arm-none-linux-gnueabi-g++
            #

            include(../../common/linux.conf)
            include(../../common/gcc-base-unix.conf)
            include(../../common/g++-unix.conf)
            include(../../common/qws.conf)

            # modifications to g++.conf
            QMAKE_CC = arm-none-linux-gnueabihf-gcc
            QMAKE_CXX = arm-none-linux-gnueabihf-g++
            QMAKE_LINK = arm-none-linux-gnueabihf-g++
            QMAKE_LINK_SHLIB = arm-none-inux-gnueabihf-g++

            # modifications to linux.conf
            QMAKE_AR = arm-linux-gnueabihf-ar cqs
            QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy*
            QMAKE_STRIP = arm-linux-gnueabihf-strip*

            load(qt_config)
            ################END_OF_QMAKE.CONF#################

            So you have to modify that file so it references to the compiler you've just downloaded.
            After you've modified it, it should looks like that :

            ######################QMAKE.CONF####################
            #
            # qmake configuration for building with arm-none-linux-gnueabi-g++
            #

            include(../../common/linux.conf)
            include(../../common/gcc-base-unix.conf)
            include(../../common/g++-unix.conf)
            include(../../common/qws.conf)

            # modifications to g++.conf
            QMAKE_CC = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc
            QMAKE_CXX = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
            QMAKE_LINK = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
            QMAKE_LINK_SHLIB = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

            # modifications to linux.conf
            QMAKE_AR = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-ar cqs
            QMAKE_OBJCOPY = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-objcopy
            QMAKE_STRIP = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-strip

            load(qt_config)
            ################END_OF_QMAKE.CONF#################

            When it's all done your qmake.conf is adapted and you're ready for the next part

            Fourth : Execute the Qt configure

            Go to /home/<yourUserName>/qt-everywhere-opensource-src-4.8.5/

            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++

            This might take a little while don't worry that's normal.

            Fifth : Execute the make

            When the ./configure is done, you just have to execute a make.
            It's an operation that can really take a long time, to reduce it you can use all your CPU's cores for the make. To know how many cores you have execute : grep -c ^processor /proc/cpuinfo
            Once you'll know how many core your CPU has you can use the option -j<numberOfCore + 1> with the make.

            On the machine i've executed the make I had 8 cores, so I used the option -j9 for the make

            To execute the make use : make -j<numberOfCore + 1> ARCH=arm CROSS_COMPILE=home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

            Note : The first time i launched the make i had an error about QSharedMemory line 65:5, something like that, if that happens, repete the fourth step : Execute the Qt configure. it should fix it, i've no idea how but it does.

            When the make is finished you can run : sudo make install

            Sixth : Configuring Qt

            In Qtcreator, the basical Qt IDE :

            • just select the right qmake, here it's the one in the /usr/local/Qt-4.8.5-arm/bin/ directory
            • And select the right compiler which in our case is this one : /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

            Then in the project tab add :

            • The argument -spec linux-arm-gnueabi-g++ for the qmake
            • And the argument ARCH=arm CROSS_COMPILE=/home/franck/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- for the make

            At this step, the qmake executes itself correctly, it creates a Makefile, this one is fine and the make executes correctly aswell

            Seventh : Compilation in command line

            For some reason i had to compile my project in command line, so i put it here just in case someone would have to aswell.

            First you have to run the qmake

            The command line that shall execute the qmake is : "<PathToTheQMake" '<PathToYour.pro>' -r CONFIG+=debug -spec <Compiler>

            So lets imagine i've created a project, let's call it random for exemple the command for my configuration and the project random would be : "/usr/local/Qt-4.8.5-arm/bin/qmake" 'home/<yourUserName>/projetQt/Random/random.pro' CONFIG+=debug -spec linux-arm-gnueabihf-g++

            Once the qmake is done, it has create for you a Makefile, so you just have to run : make to obtain your executable.

            You can check your executable by doing : file <NameOfExecutable>
            It should print you some stuff and somewhere in it you should find ARCH=arm or something like that.

            Eighth : Script that does it for you

            For the lazy ones i've created a litlle script, that i know can be improved by many ways but that works and is enough for me for now.
            Here is a functionnal version just adapt the lines 90 to 96, change the username felix by your's.
            GitHub Link

            Here is another on that should adapt itself, but that i've not tested yet. As soon as i can confirm it works i'll comfirm it
            GitHub Link

            W Offline
            W Offline
            wowy
            wrote on last edited by
            #6

            @Spader42
            On your arm device, do you have a screen/touch screen and needed to use tslib for it ?

            1 Reply Last reply
            0
            • S Spader42

              Hi there, i didn't know where to post that, so i post it here. For a few days now i've been trying to build Qt from source to cross compile my apps for an arm architecture ( pcduino for me ). I've not find a lot of help online, so as i've finally managed to cross compile my qt projects, i've decided to post online what i've done.

              I advice you to create a folder where you'll place everything you'll download below, I created the folder /home/<yourUserName>/installQt/

              First : Download qt-sdk

              I've used the 4.8.5 verson of Qt ( i've never tried with another version it might not function the same way )
              You can download it here : QT 4.8.5
              Or use : wget -c http://download.qt.io/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
              Once it's downloaded, extract it.
              You can use this to uncompress your tar.gz : tar xzvf qt-everywhere-opensource-src-4.8.5.tar.gz

              Second : Download the ARM compiler

              You can download it here : ARM Compiler
              Or do just like before : wget -c https://launchpadlibrarian.net/155358238/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
              As you did with the Qt archive you can uncompress it with : tar xJf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz

              At this step you're supposed to have two folder in your installQt directory :

              • qt-everywhere-opensource-src-4.8.5
              • gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux

              You can check the compiler by doing /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc --version

              It should print you something like that :

              arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 (prerelease)
              Copyright © 2013 Free Software Foundation, Inc.
              Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

              I guess it adapts itself to your PC's langage, you should get something like that but in your langage.

              Third : Adapt the qmake.conf file of the qt-sqk you've downloaded

              Modify the file /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
              You can do it with your favorite text editor, for example : vi /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
              The not modified version should looks like this :

              ######################QMAKE.CONF####################
              #
              # qmake configuration for building with arm-none-linux-gnueabi-g++
              #

              include(../../common/linux.conf)
              include(../../common/gcc-base-unix.conf)
              include(../../common/g++-unix.conf)
              include(../../common/qws.conf)

              # modifications to g++.conf
              QMAKE_CC = arm-none-linux-gnueabihf-gcc
              QMAKE_CXX = arm-none-linux-gnueabihf-g++
              QMAKE_LINK = arm-none-linux-gnueabihf-g++
              QMAKE_LINK_SHLIB = arm-none-inux-gnueabihf-g++

              # modifications to linux.conf
              QMAKE_AR = arm-linux-gnueabihf-ar cqs
              QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy*
              QMAKE_STRIP = arm-linux-gnueabihf-strip*

              load(qt_config)
              ################END_OF_QMAKE.CONF#################

              So you have to modify that file so it references to the compiler you've just downloaded.
              After you've modified it, it should looks like that :

              ######################QMAKE.CONF####################
              #
              # qmake configuration for building with arm-none-linux-gnueabi-g++
              #

              include(../../common/linux.conf)
              include(../../common/gcc-base-unix.conf)
              include(../../common/g++-unix.conf)
              include(../../common/qws.conf)

              # modifications to g++.conf
              QMAKE_CC = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc
              QMAKE_CXX = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
              QMAKE_LINK = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
              QMAKE_LINK_SHLIB = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

              # modifications to linux.conf
              QMAKE_AR = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-ar cqs
              QMAKE_OBJCOPY = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-objcopy
              QMAKE_STRIP = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-strip

              load(qt_config)
              ################END_OF_QMAKE.CONF#################

              When it's all done your qmake.conf is adapted and you're ready for the next part

              Fourth : Execute the Qt configure

              Go to /home/<yourUserName>/qt-everywhere-opensource-src-4.8.5/

              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++

              This might take a little while don't worry that's normal.

              Fifth : Execute the make

              When the ./configure is done, you just have to execute a make.
              It's an operation that can really take a long time, to reduce it you can use all your CPU's cores for the make. To know how many cores you have execute : grep -c ^processor /proc/cpuinfo
              Once you'll know how many core your CPU has you can use the option -j<numberOfCore + 1> with the make.

              On the machine i've executed the make I had 8 cores, so I used the option -j9 for the make

              To execute the make use : make -j<numberOfCore + 1> ARCH=arm CROSS_COMPILE=home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

              Note : The first time i launched the make i had an error about QSharedMemory line 65:5, something like that, if that happens, repete the fourth step : Execute the Qt configure. it should fix it, i've no idea how but it does.

              When the make is finished you can run : sudo make install

              Sixth : Configuring Qt

              In Qtcreator, the basical Qt IDE :

              • just select the right qmake, here it's the one in the /usr/local/Qt-4.8.5-arm/bin/ directory
              • And select the right compiler which in our case is this one : /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

              Then in the project tab add :

              • The argument -spec linux-arm-gnueabi-g++ for the qmake
              • And the argument ARCH=arm CROSS_COMPILE=/home/franck/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- for the make

              At this step, the qmake executes itself correctly, it creates a Makefile, this one is fine and the make executes correctly aswell

              Seventh : Compilation in command line

              For some reason i had to compile my project in command line, so i put it here just in case someone would have to aswell.

              First you have to run the qmake

              The command line that shall execute the qmake is : "<PathToTheQMake" '<PathToYour.pro>' -r CONFIG+=debug -spec <Compiler>

              So lets imagine i've created a project, let's call it random for exemple the command for my configuration and the project random would be : "/usr/local/Qt-4.8.5-arm/bin/qmake" 'home/<yourUserName>/projetQt/Random/random.pro' CONFIG+=debug -spec linux-arm-gnueabihf-g++

              Once the qmake is done, it has create for you a Makefile, so you just have to run : make to obtain your executable.

              You can check your executable by doing : file <NameOfExecutable>
              It should print you some stuff and somewhere in it you should find ARCH=arm or something like that.

              Eighth : Script that does it for you

              For the lazy ones i've created a litlle script, that i know can be improved by many ways but that works and is enough for me for now.
              Here is a functionnal version just adapt the lines 90 to 96, change the username felix by your's.
              GitHub Link

              Here is another on that should adapt itself, but that i've not tested yet. As soon as i can confirm it works i'll comfirm it
              GitHub Link

              J Offline
              J Offline
              josegua94
              wrote on last edited by
              #7

              @Spader42

              Hi, I am sorry to bother you, but could you tell me if I could use that cross-compile toolchain and procedure for a BeagleBone Black running Debian?

              1 Reply Last reply
              0
              • S Spader42

                Hi there, i didn't know where to post that, so i post it here. For a few days now i've been trying to build Qt from source to cross compile my apps for an arm architecture ( pcduino for me ). I've not find a lot of help online, so as i've finally managed to cross compile my qt projects, i've decided to post online what i've done.

                I advice you to create a folder where you'll place everything you'll download below, I created the folder /home/<yourUserName>/installQt/

                First : Download qt-sdk

                I've used the 4.8.5 verson of Qt ( i've never tried with another version it might not function the same way )
                You can download it here : QT 4.8.5
                Or use : wget -c http://download.qt.io/archive/qt/4.8/4.8.5/qt-everywhere-opensource-src-4.8.5.tar.gz
                Once it's downloaded, extract it.
                You can use this to uncompress your tar.gz : tar xzvf qt-everywhere-opensource-src-4.8.5.tar.gz

                Second : Download the ARM compiler

                You can download it here : ARM Compiler
                Or do just like before : wget -c https://launchpadlibrarian.net/155358238/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz
                As you did with the Qt archive you can uncompress it with : tar xJf gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux.tar.xz

                At this step you're supposed to have two folder in your installQt directory :

                • qt-everywhere-opensource-src-4.8.5
                • gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux

                You can check the compiler by doing /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc --version

                It should print you something like that :

                arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2013.10 - Linaro GCC 2013.10) 4.8.2 20131014 (prerelease)
                Copyright © 2013 Free Software Foundation, Inc.
                Ce logiciel est libre; voir les sources pour les conditions de copie. Il n'y a PAS GARANTIE; ni implicite pour le MARCHANDAGE ou pour un BUT PARTICULIER.

                I guess it adapts itself to your PC's langage, you should get something like that but in your langage.

                Third : Adapt the qmake.conf file of the qt-sqk you've downloaded

                Modify the file /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
                You can do it with your favorite text editor, for example : vi /home/<yourUserName>/installQt/qt-everywhere-opensource-src-4.8.5/mksepcs/qws/linux-arm-gnueabi-g++/qmake.conf
                The not modified version should looks like this :

                ######################QMAKE.CONF####################
                #
                # qmake configuration for building with arm-none-linux-gnueabi-g++
                #

                include(../../common/linux.conf)
                include(../../common/gcc-base-unix.conf)
                include(../../common/g++-unix.conf)
                include(../../common/qws.conf)

                # modifications to g++.conf
                QMAKE_CC = arm-none-linux-gnueabihf-gcc
                QMAKE_CXX = arm-none-linux-gnueabihf-g++
                QMAKE_LINK = arm-none-linux-gnueabihf-g++
                QMAKE_LINK_SHLIB = arm-none-inux-gnueabihf-g++

                # modifications to linux.conf
                QMAKE_AR = arm-linux-gnueabihf-ar cqs
                QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy*
                QMAKE_STRIP = arm-linux-gnueabihf-strip*

                load(qt_config)
                ################END_OF_QMAKE.CONF#################

                So you have to modify that file so it references to the compiler you've just downloaded.
                After you've modified it, it should looks like that :

                ######################QMAKE.CONF####################
                #
                # qmake configuration for building with arm-none-linux-gnueabi-g++
                #

                include(../../common/linux.conf)
                include(../../common/gcc-base-unix.conf)
                include(../../common/g++-unix.conf)
                include(../../common/qws.conf)

                # modifications to g++.conf
                QMAKE_CC = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-gcc
                QMAKE_CXX = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
                QMAKE_LINK = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++
                QMAKE_LINK_SHLIB = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

                # modifications to linux.conf
                QMAKE_AR = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-ar cqs
                QMAKE_OBJCOPY = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-objcopy
                QMAKE_STRIP = /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-strip

                load(qt_config)
                ################END_OF_QMAKE.CONF#################

                When it's all done your qmake.conf is adapted and you're ready for the next part

                Fourth : Execute the Qt configure

                Go to /home/<yourUserName>/qt-everywhere-opensource-src-4.8.5/

                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++

                This might take a little while don't worry that's normal.

                Fifth : Execute the make

                When the ./configure is done, you just have to execute a make.
                It's an operation that can really take a long time, to reduce it you can use all your CPU's cores for the make. To know how many cores you have execute : grep -c ^processor /proc/cpuinfo
                Once you'll know how many core your CPU has you can use the option -j<numberOfCore + 1> with the make.

                On the machine i've executed the make I had 8 cores, so I used the option -j9 for the make

                To execute the make use : make -j<numberOfCore + 1> ARCH=arm CROSS_COMPILE=home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-

                Note : The first time i launched the make i had an error about QSharedMemory line 65:5, something like that, if that happens, repete the fourth step : Execute the Qt configure. it should fix it, i've no idea how but it does.

                When the make is finished you can run : sudo make install

                Sixth : Configuring Qt

                In Qtcreator, the basical Qt IDE :

                • just select the right qmake, here it's the one in the /usr/local/Qt-4.8.5-arm/bin/ directory
                • And select the right compiler which in our case is this one : /home/<yourUserName>/installQt/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf-g++

                Then in the project tab add :

                • The argument -spec linux-arm-gnueabi-g++ for the qmake
                • And the argument ARCH=arm CROSS_COMPILE=/home/franck/gcc-linaro-arm-linux-gnueabihf-4.8-2013.10_linux/bin/arm-linux-gnueabihf- for the make

                At this step, the qmake executes itself correctly, it creates a Makefile, this one is fine and the make executes correctly aswell

                Seventh : Compilation in command line

                For some reason i had to compile my project in command line, so i put it here just in case someone would have to aswell.

                First you have to run the qmake

                The command line that shall execute the qmake is : "<PathToTheQMake" '<PathToYour.pro>' -r CONFIG+=debug -spec <Compiler>

                So lets imagine i've created a project, let's call it random for exemple the command for my configuration and the project random would be : "/usr/local/Qt-4.8.5-arm/bin/qmake" 'home/<yourUserName>/projetQt/Random/random.pro' CONFIG+=debug -spec linux-arm-gnueabihf-g++

                Once the qmake is done, it has create for you a Makefile, so you just have to run : make to obtain your executable.

                You can check your executable by doing : file <NameOfExecutable>
                It should print you some stuff and somewhere in it you should find ARCH=arm or something like that.

                Eighth : Script that does it for you

                For the lazy ones i've created a litlle script, that i know can be improved by many ways but that works and is enough for me for now.
                Here is a functionnal version just adapt the lines 90 to 96, change the username felix by your's.
                GitHub Link

                Here is another on that should adapt itself, but that i've not tested yet. As soon as i can confirm it works i'll comfirm it
                GitHub Link

                J Offline
                J Offline
                josegua94
                wrote on last edited by
                #8

                I am sorry to bother you guys but I'm trying to follow this tutorial and I get stuck in the next part:

                ./configure -opensource...

                I get the following message: "make: g++: Command not found" AND "make: *** [project.o] Error 127
                I am currently working on a ubuntu 64 bits Machine mounted on VirtualBox and my target is a BeagleBone Black running Debian. Take it as if I had no knowledge what so ever because it is practically that way. Any advice that you could give me is greatly appreciated.

                Thank you.

                1 Reply Last reply
                0
                • citiustechC Offline
                  citiustechC Offline
                  citiustech
                  wrote on last edited by
                  #9

                  I have follow all the steps...and i am able to create a makefile for arm architecture...but getting error in make...i am working on qt5.5

                  jsulmJ 1 Reply Last reply
                  0
                  • citiustechC citiustech

                    I have follow all the steps...and i am able to create a makefile for arm architecture...but getting error in make...i am working on qt5.5

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #10

                    @citiustech Hi! What is the error you get?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • citiustechC Offline
                      citiustechC Offline
                      citiustech
                      wrote on last edited by
                      #11

                      do you have any steps for cross compile qt5.5 for arm

                      1 Reply Last reply
                      0
                      • citiustechC Offline
                        citiustechC Offline
                        citiustech
                        wrote on last edited by
                        #12

                        QOpenglwidget file is included in my application..it is build on qt5.5. but giving file error while make using QT4.8 that QOpenGLWidget no such file.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #13

                          Hi,

                          That's because QOpenGLWidget is a new class of Qt 5. Qt 4 has QGLWidget.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • citiustechC Offline
                            citiustechC Offline
                            citiustech
                            wrote on last edited by
                            #14

                            Thank for your valueable reply

                            1 Reply Last reply
                            0
                            • citiustechC Offline
                              citiustechC Offline
                              citiustech
                              wrote on last edited by
                              #15

                              i am trying to build qt5.5 for arm but getting error while build.
                              i am using ./configue -xplatform inux-arm-gnueabi-g++ command. it gives openssl error. openssl.h no such file?

                              can you please suggest

                              1 Reply Last reply
                              0
                              • SGaistS Offline
                                SGaistS Offline
                                SGaist
                                Lifetime Qt Champion
                                wrote on last edited by
                                #16

                                Unless you specified that you want OpenSSL support it should not stop the build. If you want OpenSSL support then you need to provide that dependencies for your target.

                                Interested in AI ? www.idiap.ch
                                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                1 Reply Last reply
                                0
                                • citiustechC Offline
                                  citiustechC Offline
                                  citiustech
                                  wrote on last edited by
                                  #17

                                  DO you have any Build steps like QT4.8.5 for QT5.5?

                                  1 Reply Last reply
                                  0
                                  • SGaistS Offline
                                    SGaistS Offline
                                    SGaist
                                    Lifetime Qt Champion
                                    wrote on last edited by
                                    #18

                                    That usually depends partly on the device you are targeting.

                                    Interested in AI ? www.idiap.ch
                                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                    1 Reply Last reply
                                    0
                                    • citiustechC Offline
                                      citiustechC Offline
                                      citiustech
                                      wrote on last edited by
                                      #19

                                      i am cross compiling qt for cubieboard 4.
                                      can you please suggest me ./configure command ?

                                      1 Reply Last reply
                                      0
                                      • SGaistS Offline
                                        SGaistS Offline
                                        SGaist
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #20

                                        I don't know this board but a quick search returns this blog entry which step 4 is likely what you are looking for to get started.

                                        Interested in AI ? www.idiap.ch
                                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        0
                                        • citiustechC Offline
                                          citiustechC Offline
                                          citiustech
                                          wrote on last edited by
                                          #21

                                          Hello. The above solution is working fine for no-opengl.
                                          once opengl es2 enable for cross compile it gives opengl functionality test failed error. i have copied all the GL/GLES2 file from arm board to ubuntu pc and edit qmake.conf file. but it gives the same error.
                                          how to cross compile qt for arm with opengl. can you please suggest?

                                          1 Reply Last reply
                                          0

                                          • Login

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved