Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. cross compiling qt5 tools for target
Forum Updated to NodeBB v4.3 + New Features

cross compiling qt5 tools for target

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
9 Posts 4 Posters 2.6k Views 2 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.
  • F Offline
    F Offline
    fatih.erol
    wrote on last edited by
    #1

    hi.

    i am cross compiling qt5 on a 64-bit intel machine for a 32-bit intel device. in this case, qmake/moc/rcc/uic tools are generated for the 64-bit host machine, which i use as part of a cross-compilation toolchain.

    however, i would like to also build these tools for the 32-bit target device, in case i want to compile qt applications directly on the device. how would one generate these tools also for the target device?

    thanks.

    jsulmJ 1 Reply Last reply
    0
    • L Offline
      L Offline
      Leonardo
      wrote on last edited by
      #2

      Compiling Qt and its tools only wouldn't be enough, as they still rely on GCC, MinGW, MSVC or whatever you're using to build the applications. You would need one of these compilers on the device also. Are you sure that's what you want? If you are, you can edit the platform specs you're using on your configure command and add the compiler flags for compiling 32bits binaries. You can find them at qtbase/mkspecs.

      F 1 Reply Last reply
      0
      • F fatih.erol

        hi.

        i am cross compiling qt5 on a 64-bit intel machine for a 32-bit intel device. in this case, qmake/moc/rcc/uic tools are generated for the 64-bit host machine, which i use as part of a cross-compilation toolchain.

        however, i would like to also build these tools for the 32-bit target device, in case i want to compile qt applications directly on the device. how would one generate these tools also for the target device?

        thanks.

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

        @fatih.erol You can simply build Qt on your target device (if you have all needed dependencies there).

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

        F 1 Reply Last reply
        0
        • jsulmJ jsulm

          @fatih.erol You can simply build Qt on your target device (if you have all needed dependencies there).

          F Offline
          F Offline
          fatih.erol
          wrote on last edited by
          #4

          @jsulm This would be too slow on the target device. Is there a specific make target for just these tools?

          1 Reply Last reply
          0
          • L Leonardo

            Compiling Qt and its tools only wouldn't be enough, as they still rely on GCC, MinGW, MSVC or whatever you're using to build the applications. You would need one of these compilers on the device also. Are you sure that's what you want? If you are, you can edit the platform specs you're using on your configure command and add the compiler flags for compiling 32bits binaries. You can find them at qtbase/mkspecs.

            F Offline
            F Offline
            fatih.erol
            wrote on last edited by fatih.erol
            #5

            @Leonardo The target device does have the other build tools and libraries. What I need is a Qt configure option or a make target, so that while cross-compiling Qt on 64-bit development system, these tools are generated not only for the 64-bit host system but also for the 32-bit target platform. For example, the xmlpatterns executable is generated for the 32-bit target platform.

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

              Hi,

              The host tools are never cross-compiled as they are meant to be used from the host.

              If you want a fully operational Qt on your target then you should build it as @jsulm suggested.

              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
              2
              • L Offline
                L Offline
                Leonardo
                wrote on last edited by
                #7

                I assumed you had the same operating system on both the host machine and the device. If that's the case, you could just add the "-platform <name here>" flag when calling "configure". You can see all supported platforms at qtbase/mkspecs.

                If the operating system is not the same, then @SGaist is right. It's not possible. Everything should be built on the device itself.

                1 Reply Last reply
                1
                • F Offline
                  F Offline
                  fatih.erol
                  wrote on last edited by
                  #8

                  The host system is 64-bit Ubuntu 14.04. The target system is 32-bit ArchLinux with an older kernel.
                  So, I guess, I either have to write a cmake/qmake/Makefile for these tools similar to cross-compiled executables such as xmlpatterns, or, I build on the target directly.
                  In case of building on the target (which would be rather slow), will the following be the minimal make targets to build these executables:

                  cd ${BUILD_DIR}
                  ${QT_SRC_DIR}/configure ...
                  make -C ${BUILD_DIR}/qtbase/src sub-bootstrap qmake sub-moc sub-rcc sub-uic
                  
                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    Leonardo
                    wrote on last edited by
                    #9

                    I don't think building the libraries in one machine and the tools in another one is a good idea. Maybe you could build it using a virtual machine. It will be faster than building on the device. After that, all you have to do is copy the files to the device.

                    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