View Full Version : Crosscompile Qt in Linux

8th April 2006, 00:43
Is it possible to setup Linux and gcc so that I can compile my Qt apps in Linux, but compile them both for both Linux and MS Windows (and perhaps even Mac) with gcc?
Any advice on how to do it, if possible?

8th April 2006, 07:04
i think u can write the platform specific codes in your .cpp files, .h files and .pro file also so that it may compile and make an executable for all platforms, but compiling for other platform on some other platform, i don think its possible.

But what u want to do by getting the exec. for all the platforms ... they gonna work the same way ... though the look and feel can be different on them all..

Then also this is my thinking .... somebody experienced can put some more light on this topic

8th April 2006, 11:08
As I know you may compile and install crosscompiler under Linux, for example MinGW (http://mingw.org) and compile windows executables with it. Also read this: build a Win32 x-compiler for Linux (http://mingw.org/MinGWiki/index.php/build%20a%20Win32%20x-compiler%20for%20Linux)
P.S. My attempt to compile it failed. Please share your experience with us.

9th April 2006, 18:14
I have had success compiling very simple w32 apps on linux with the debian packges for ming32 on my debian box. I haven't tried with Qt. I think you would have to compile the windows qt4 with ming and possible hack them to use the wine libs for a the system calls, I'm not sure.

13th April 2006, 18:19
If you take the libs from $QTDIR/lib and headers from $QTDIR/include your aught to be able to build a cross compiled mingw-compatible version using the Qt-dlls provided with the win32 version of Qt.