Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt5.6 Cross Compile
Forum Updated to NodeBB v4.3 + New Features

Qt5.6 Cross Compile

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 3 Posters 3.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.
  • CJ-SurC Offline
    CJ-SurC Offline
    CJ-Sur
    wrote on last edited by A Former User
    #1

    Hi.

    I wish to use the Qt to develop an application (Windows, Linux, Mac OS support), but I do have two questions.

    1. Does Qt support build the application for 3 platforms in 1 platform, or I have to compile the source code in the corresponding operation system?
      For example, in Windows, can build the windows exe application; but does it support to build the Linux and Max OS application. Or in Linux, does Qt support to build the Windows and Mac OS application.

    2. Does the Qt support build command in the command line(qmake, make??). Any automation build command?

    PS : is there any wonderful graphical lib (open source) to recommend.

    Thanks.

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      On Windows it is possible to build for Linux (never tried). On Linux you can build for Windows using MinGW (never tried as well). But in both cases you should expect limitations and problems. For MacOS you have to use XCode and that is only available on Mac!
      In any case I would recommend to build directly on the platform you're targeting.

      If you want to cross compile then you have to cross compile Qt as well.

      One wonderful graphical lib is Qt :-)

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

      CJ-SurC 1 Reply Last reply
      1
      • jsulmJ jsulm

        On Windows it is possible to build for Linux (never tried). On Linux you can build for Windows using MinGW (never tried as well). But in both cases you should expect limitations and problems. For MacOS you have to use XCode and that is only available on Mac!
        In any case I would recommend to build directly on the platform you're targeting.

        If you want to cross compile then you have to cross compile Qt as well.

        One wonderful graphical lib is Qt :-)

        CJ-SurC Offline
        CJ-SurC Offline
        CJ-Sur
        wrote on last edited by
        #3

        @jsulm
        Thanks for your reply.

        In Mac OS, QT5.6 is ready to build the qt project (which i create the project on Windows). And I do have tried for this.
        For windows static release, i've build the windows QT source code, and i can add the kit into QtCreator, and works fine.

        I guess, if download the Linux/Mac OS QT source code, and build the source code, then add the kit into QtCreator, maybe this is possible.

        Thanks.

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

          I'm not really sure what you mean.
          Do you still want to cross compile?
          If not then there is no need to build Qt by yourself (except you want static libraries).
          Be careful if you use static Qt libraries: check GPLv3 license.

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

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Rondog
            wrote on last edited by Rondog
            #5

            I think your definition of 'cross compile' is to have one application that can run on different platforms (question 1). The answer is no, you need to compile your source code for each OS you intend to run the program on.

            Support for terminal / console is provided by all OS's. If you want to compile your program from a command line then this is not a problem (question 2). What is available is more from your choice of compiler or toolkit as opposed to anything else. Automation is not a problem either (I assume you are thinking along the lines of scripts or batch files).

            'Cross Compile' means that you are running one OS and you are compiling applications that will run on another OS or hardware platform. It is common to do this for things like an IPhone for example.

            Note, it is 'Qt' and not 'QT'. The latter is Apple's Quick Time...

            jsulmJ 1 Reply Last reply
            0
            • R Rondog

              I think your definition of 'cross compile' is to have one application that can run on different platforms (question 1). The answer is no, you need to compile your source code for each OS you intend to run the program on.

              Support for terminal / console is provided by all OS's. If you want to compile your program from a command line then this is not a problem (question 2). What is available is more from your choice of compiler or toolkit as opposed to anything else. Automation is not a problem either (I assume you are thinking along the lines of scripts or batch files).

              'Cross Compile' means that you are running one OS and you are compiling applications that will run on another OS or hardware platform. It is common to do this for things like an IPhone for example.

              Note, it is 'Qt' and not 'QT'. The latter is Apple's Quick Time...

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

              @Rondog No, his definition of "cross compile" is correct: build on one OS for several other OS (for example build on Windows and build for Mac and Linux).

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

              1 Reply Last reply
              0
              • R Offline
                R Offline
                Rondog
                wrote on last edited by Rondog
                #7

                @jsulm Sorry, 'cross compile' means that you are compiling for a specific target OS or hardware from some other OS or hardware.

                Regardless Qt does not provide any option to create one program that will run on different OS's . You can write one program that can be compiled (unchanged) to run on a different OS but you cannot compile once and have the end result run on different OS's. In terms of cross platform I believe Qt is one of the best options avaiable.

                In order to have one program capable of running on different OS's there would need to be a lot of cooperation between the different vendors. I wouldn't hold my breath...

                CJ-SurC jsulmJ 2 Replies Last reply
                0
                • R Rondog

                  @jsulm Sorry, 'cross compile' means that you are compiling for a specific target OS or hardware from some other OS or hardware.

                  Regardless Qt does not provide any option to create one program that will run on different OS's . You can write one program that can be compiled (unchanged) to run on a different OS but you cannot compile once and have the end result run on different OS's. In terms of cross platform I believe Qt is one of the best options avaiable.

                  In order to have one program capable of running on different OS's there would need to be a lot of cooperation between the different vendors. I wouldn't hold my breath...

                  CJ-SurC Offline
                  CJ-SurC Offline
                  CJ-Sur
                  wrote on last edited by
                  #8

                  @Rondog
                  Hi sir:
                  For the description of "cross compile", I mean is there any possibility to build the Linux/Mac executable application in windows platform, Or build the Windows/Mac executable application in the Linux OS.

                  I know and I've built the same source code (NOT changed) in different platform (Windows and Mac), and the executable application is OK to run.

                  1 Reply Last reply
                  0
                  • R Rondog

                    @jsulm Sorry, 'cross compile' means that you are compiling for a specific target OS or hardware from some other OS or hardware.

                    Regardless Qt does not provide any option to create one program that will run on different OS's . You can write one program that can be compiled (unchanged) to run on a different OS but you cannot compile once and have the end result run on different OS's. In terms of cross platform I believe Qt is one of the best options avaiable.

                    In order to have one program capable of running on different OS's there would need to be a lot of cooperation between the different vendors. I wouldn't hold my breath...

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

                    @Rondog "You can write one program that can be compiled (unchanged) to run on a different OS" - that's what @CJ-Sur and I mean.

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

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Rondog
                      wrote on last edited by
                      #10

                      @CJ-Sur In theory you can but I haven't heard of anything that you can setup on Windows that would allow you to generate GNU/Linux / OS X executables. GNU/Linux has tool chains that will generate Windows executables that I have seen and this likely has the most options available.

                      If I was doing this I would look into setting up a virtual machine for each target OS you want to run your application on. I have, for example, Windows installed in a VM on my GNU/Linux and Apple computers. When I want to produce something for Windows I compile and test inside the VM. If you generate a GNU/Linux application in Windows outside of a VM you then have to find a computer running GNU/Linux to test it on. A VM solves many problems.

                      CJ-SurC 1 Reply Last reply
                      0
                      • R Rondog

                        @CJ-Sur In theory you can but I haven't heard of anything that you can setup on Windows that would allow you to generate GNU/Linux / OS X executables. GNU/Linux has tool chains that will generate Windows executables that I have seen and this likely has the most options available.

                        If I was doing this I would look into setting up a virtual machine for each target OS you want to run your application on. I have, for example, Windows installed in a VM on my GNU/Linux and Apple computers. When I want to produce something for Windows I compile and test inside the VM. If you generate a GNU/Linux application in Windows outside of a VM you then have to find a computer running GNU/Linux to test it on. A VM solves many problems.

                        CJ-SurC Offline
                        CJ-SurC Offline
                        CJ-Sur
                        wrote on last edited by
                        #11

                        @Rondog
                        OK. Got you.
                        I'am investigating is this possible.
                        I think I have to use the corresponding desktop or the VM.

                        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