Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Cross-compilation
Forum Updated to NodeBB v4.3 + New Features

Cross-compilation

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
9 Posts 4 Posters 2.9k Views 3 Watching
  • 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.
  • A Offline
    A Offline
    abtom87
    wrote on last edited by abtom87
    #1

    I am trying to cross-compile a Qt GUI project from my Ubuntu VM on a Windows host to my BBB Wireless board. Qt Creator seems to be set up fine, also the toolchain except Qt version for ARM. I am able to deploy the binary successfully on my target, but its x86-64 architecture and not ARM as expected. My question is how can i get a qmake which is ARM specefic and not gcc generic. I went online and saw a few tutorials, most of them suggested changing the corresponding qmake.conf file, in this case ARm and doing a ./configure. but it is not possible for me since i installed Qt creator from a .run file which implicitly installed Qt as well.

    Edit1:
    Ubuntu version: 16.04

    Ubuntu_terminal:~qtchooser -l
    
    4
    5
    default
    qt4-x86_64-linux-gnu
    qt4
    qt5-x86_64-linux-gnu
    qt5
    

    Beaglebone OS: Debian

    BBB_terminal:~qtchooser -l
    4
    5
    default
    qt4-arm-linux-gnueabihf
    qt4
    qt5-arm-linux-gnueabihf
    qt5
    
    1 Reply Last reply
    0
    • A Offline
      A Offline
      abtom87
      wrote on last edited by
      #7

      Soooo,
      After ,many painstaking hours and going through countless tutorials, I finally managed to cross-compile my Qt on my VM, now I can Deploy the correct binary on my BBB. :)

      I installed the Qtcreator from the .run file and I said I want the source files also along with it. After installation, I tried various things with ./configure , until I executed this:

      ./configure -v -opensource -confirm-license -prefix /opt/qt  -device-option CROSS_COMPILE=$HOME/Downloads/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -device linux-beagleboard-g++
      

      I did not have to mention sysroot, which seems to be a bit strange.
      After that I did make and make install of course. I had to restart Qtcreator and specify Qt for ARM in the right place and I am all good. :)

      jsulmJ 1 Reply Last reply
      1
      • Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #2

        @abtom87 I guess you may already looked at this guide but just in case, maybe repeating the steps again... This post, although not specific for your device, may help understanding what people is doing while cross-compiling Qt. In that post you'll also find some links to cross-compiling for other ARM devices (i.e. Raspberry Pi)

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        1
        • A Offline
          A Offline
          abtom87
          wrote on last edited by
          #3

          Now i read the reply regarding TI board, sysroot also specified now, the binary deployed is still not ARM compatible. i copied the entire rootfs folder of BBB on my VM ubuntu and thats my sysroot now in Qtcreator, no luck.

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

            Hi and welcome to devnet,

            Did you cross-compile Qt 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

            A 1 Reply Last reply
            1
            • SGaistS SGaist

              Hi and welcome to devnet,

              Did you cross-compile Qt for your target ?

              A Offline
              A Offline
              abtom87
              wrote on last edited by
              #5

              @SGaist No sir, not yet, i am guessing i need to download the latest qt-base and build it.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                abtom87
                wrote on last edited by
                #6

                I downloaded qtbase 5.6 from git and tried to build using

                ./configure -embedded arm -xplatform mkspecs/linux-arm-gnueabi-g++
                

                and this is the output:

                -embedded: invalid command-line switch
                arm: unknown argument
                
                

                Once i removed embedded and arm, i get the following output:

                /qtbase-5.6$ ./configure -opensource -confirm-license -xplatform mkspecs/linux-arm-gnueabi-g++ 
                
                This is the Qt Open Source Edition.
                
                You are licensed to use this software under the terms of
                the GNU Lesser General Public License (LGPL) version 2.1.
                You are also licensed to use this software under the terms of
                the GNU Lesser General Public License (LGPL) version 3.
                
                You have already accepted the terms of the Open Source license.
                
                Running configuration tests (phase 1)...
                Done running configuration tests.
                Creating qmake...
                .In file included from /home/abel/Downloads/qtbase-5.6/qmake/library/qmake_global.h:37:0,
                                 from /$HOME/qtbase-5.6/qmake/library/qmakeparser.h:37,
                                 from /$HOME/qtbase-5.6/qmake/library/qmakeevaluator.h:41,
                                 from /$HOME/qtbase-5.6/qmake/project.h:37,
                                 from /$HOME/qtbase-5.6/qmake/project.cpp:34:
                ../src/corelib/global/qglobal.h:75:37: fatal error: QtCore/qsystemdetection.h: No such file or directory
                compilation terminated.
                make: *** [project.o] Error 1
                
                
                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  abtom87
                  wrote on last edited by
                  #7

                  Soooo,
                  After ,many painstaking hours and going through countless tutorials, I finally managed to cross-compile my Qt on my VM, now I can Deploy the correct binary on my BBB. :)

                  I installed the Qtcreator from the .run file and I said I want the source files also along with it. After installation, I tried various things with ./configure , until I executed this:

                  ./configure -v -opensource -confirm-license -prefix /opt/qt  -device-option CROSS_COMPILE=$HOME/Downloads/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -device linux-beagleboard-g++
                  

                  I did not have to mention sysroot, which seems to be a bit strange.
                  After that I did make and make install of course. I had to restart Qtcreator and specify Qt for ARM in the right place and I am all good. :)

                  jsulmJ 1 Reply Last reply
                  1
                  • A abtom87

                    Soooo,
                    After ,many painstaking hours and going through countless tutorials, I finally managed to cross-compile my Qt on my VM, now I can Deploy the correct binary on my BBB. :)

                    I installed the Qtcreator from the .run file and I said I want the source files also along with it. After installation, I tried various things with ./configure , until I executed this:

                    ./configure -v -opensource -confirm-license -prefix /opt/qt  -device-option CROSS_COMPILE=$HOME/Downloads/gcc-linaro-6.4.1-2017.11-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -device linux-beagleboard-g++
                    

                    I did not have to mention sysroot, which seems to be a bit strange.
                    After that I did make and make install of course. I had to restart Qtcreator and specify Qt for ARM in the right place and I am all good. :)

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

                    @abtom87 said in Cross-compilation:

                    I installed the Qtcreator from the .run file and I said I want the source files also along with it

                    I guess you mean Qt, not QtCreator?

                    "I had to restart Qtcreator" - it's not needed to restart QtCreator to add new Qt installation.

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

                    1 Reply Last reply
                    3
                    • A Offline
                      A Offline
                      abtom87
                      wrote on last edited by
                      #9

                      yes you're right , i did not "have" to restart the Qt creator, since you just add the location of corresponding qmake.

                      1 Reply Last reply
                      1

                      • Login

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