How to compile a QT Application targeting for LINUX from a Windows machine
-
wrote on 19 Apr 2012, 06:27 last edited by
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.
-
wrote on 19 Apr 2012, 06:30 last edited by
What did you try already? Did you google for something like "windows linux cross compile"?
-
wrote on 19 Apr 2012, 06:42 last edited by
I am looking for a standard way provided by QT.
-
wrote on 19 Apr 2012, 06:54 last edited by
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.
-
wrote on 19 Apr 2012, 06:59 last edited by
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.
-
wrote on 19 Apr 2012, 07:25 last edited by
I am not whether Qt SDK provides the cross compilation environment yet.
-
wrote on 19 Apr 2012, 10:18 last edited by
[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. -
wrote on 21 Apr 2012, 23:11 last edited by
Added the fact that you will need a real target environment to finally test your application, won't you?
-
wrote on 24 Apr 2012, 03:18 last edited by
"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
-
wrote on 24 Apr 2012, 17:34 last edited by
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.
-
wrote on 27 Apr 2012, 03:26 last edited by
Can you provide some names of good cross-compiler with compilation steps.
-
wrote on 27 Apr 2012, 03:28 last edited by
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.
-
wrote on 27 Apr 2012, 07:27 last edited by
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.
-
wrote on 27 Apr 2012, 07:32 last edited by
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.
-
wrote on 27 Apr 2012, 07:35 last edited by
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.
-
wrote on 27 Apr 2012, 08:12 last edited by
[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/16