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. How to compile a QT Application targeting for LINUX from a Windows machine
Qt 6.11 is out! See what's new in the release blog

How to compile a QT Application targeting for LINUX from a Windows machine

Scheduled Pinned Locked Moved Installation and Deployment
16 Posts 7 Posters 25.5k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I have a QT application created in windows environment. I want the same application to be run on the Linux machine. Please tell the procedure to get this. I want to use my windows machine for compilation and I dont want to use a Linux machine or any VM to do this.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      What did you try already? Did you google for something like "windows linux cross compile"?

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        I am looking for a standard way provided by QT.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          Then look no further: there is none. Note that I don't say it's impossible to do, just that Qt (and I assume you mean the Qt SDK) does not provide it.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            GentooXativa
            wrote on last edited by
            #5

            Imho the best way is using a VM or a Remote machine if you dont want to install linux, and you can try using "cygwin":http://www.cygwin.com , but you need to prepare the whole configuration and librarys and im not sure if you can archieve that.

            Jose Vicente Giner Sanchez - Senior Mobile Developer

            www.gigigo.com

            C/ Dr. Zamenhof 36bis, 1ºA 28027 Madrid
            T: +34 917431436

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              I am not whether Qt SDK provides the cross compilation environment yet.

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #7

                [quote author="veeraps" date="1334820343"]I am not whether Qt SDK provides the cross compilation environment yet.[/quote]
                It does not, and also I think that would not make much sense. Even if the source code compiles for Linux, how could it be verified to run?
                From a complexity point of view, I think setting up a Linux machine (VM or not) and the necessary environment for Qt is a whole lot simpler than cross compiling bug hunting afterwards.

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  Added the fact that you will need a real target environment to finally test your application, won't you?

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #9

                    "this can be a worst solution" but Qt Creator provides shadow build functionality which can be used to build source for multiple targets.

                    bq. The same source code built for and running on multiple targets. Qt Creator allows developers to specify separate build settings for each development platform and to quickly switch between build targets. By default, shadow builds are used to keep the build specific files separate from the source. Developers can create separate versions of project files to keep platform-dependent code separate. They can use qmake scopes to select the file to process depending on which platform qmake is run on.

                    Quote reference: "Qt Creator Whitepaper":http://qt-project.org/wiki/QtCreatorWhitepaper

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by
                      #10

                      What we are trying to say is that while it is possible to solely cross-compile, it is probably not a good way to get the program to actually run properly. But I think the answer is that no Linux cross compiler comes with Qt Creator for Windows, so you will have to get it from somewhere else.

                      1 Reply Last reply
                      0
                      • ? Offline
                        ? Offline
                        A Former User
                        wrote on last edited by
                        #11

                        Can you provide some names of good cross-compiler with compilation steps.

                        1 Reply Last reply
                        0
                        • ? Offline
                          ? Offline
                          A Former User
                          wrote on last edited by
                          #12

                          Hi Miroslav,

                          The reason why i am trying to use the Windows machine is, we have license only for building qt in windows machine with target for multiple OS. Because of this, i am not looking into the compilation with Linux machine.

                          1 Reply Last reply
                          0
                          • ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by
                            #13

                            Hi Jothi,

                            [quote author="JothiMurugeswaran" date="1335497329"]The reason why i am trying to use the Windows machine is, we have license only for building qt in windows machine with target for multiple OS. Because of this, i am not looking into the compilation with Linux machine.[/quote]

                            That sounds strange. Nobody uses the commercial Qt license these days unless they have to. Unless there are concrete legal reasons that prevent it, you can use the LGPL Qt version on Linux. It actually comes out of the box on most distributions.

                            1 Reply Last reply
                            0
                            • A Offline
                              A Offline
                              andre
                              wrote on last edited by
                              #14

                              Strange indeed. I doubt you got yourself a Qt license that does not permit you to build your *nix binaries on *nix itself, but does permit the same on windows. If that's your interperttation of the license, I suggest you read it again and/or contact Digia for an explanation.

                              1 Reply Last reply
                              0
                              • ? Offline
                                ? Offline
                                A Former User
                                wrote on last edited by
                                #15

                                Hi Jothi,

                                [quote author="JothiMurugeswaran" date="1335497167"]Can you provide some names of good cross-compiler with compilation steps.[/quote]

                                I doubt you will have success with that here. It is simply something nobody ever does. And building a cross-compiler is not exactly a piece of cake.

                                1 Reply Last reply
                                0
                                • ? Offline
                                  ? Offline
                                  A Former User
                                  wrote on last edited by
                                  #16

                                  [quote author="JothiMurugeswaran" date="1335497329"]Hi Miroslav,

                                  The reason why i am trying to use the Windows machine is, we have license only for building qt in windows machine with target for multiple OS. Because of this, i am not looking into the compilation with Linux machine.[/quote]

                                  If you're not allowed to build Qt on a Linux machine, then I seriously doubt that you can build on a Windows machine for a Linux target. Cross compiling falls into the same category as running a Linux VM on the Windows box - just IMHO, I'm not a lawyer. If in doubt, contact Digia, as stated already.

                                  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