View Full Version : Creating executable for windows using QT program in Linux

8th June 2009, 08:10

Is it possible to create an executable for Linux and windows using the same QT code in Linux with Eclipse integration or is it necessary to install QT Creator in my Linux machine?

Waiting for reply

Thanks in advance


8th June 2009, 08:36
Yes, it's possible provided you have a cross-compiler.

8th June 2009, 10:23
pls tel me which is the cross compiler to be used in Linux?

8th June 2009, 11:24
Please use a web search engine to find information about cross-compilers. As for me you can use GCC/MinGW.

8th June 2009, 11:41
Can i use QT Creator in Linux just to create executable for Windows.???
or is Cross compiler must to use??

I guess QT creator in Linux will be having an option to build code for windows??
if i'm wrong pls do suggest me

Sorry for the trouble....

8th June 2009, 14:42
Qt Creator is a text editor, not a compiler. You need a compiler to do the compilation. Qt Creator doesn't have "options to create binaries for X". This is done by qmake and the compiler. You change the target you build for by pointing qmake to a proper specification file. Then qmake will generate a makefile for a specific (cross)compiler you need to have.

9th June 2009, 05:19
ok thanks..but i'm bit comfused....

I have developed a small project with Qt Eclipse integration on linux and i would like to make a windows executable file (.exe) for the same project using QT, So, my app could run on both systems.
will my QT with Eclipse as plugin help me to generate .exe in Linux.

pls tel me what is the procedure to get .exe from Linux and what has to be installed???

9th June 2009, 08:01
It would really be better if you just read about cross-compiling on the Internet.

Start with these:

9th June 2009, 10:22
I am kindof lazy, and found cross compiling to be tedious, so I just installed a copy of windows in either the free Vmware or Virtualbox. I then use the Mingw Qt in the virtual machine.

The exact same source code can then compile on your Linux host, and in the virtual machine, with the added value that you can use the virtual machine to not only compile the Qt code, but also to test it in windows, especially if you have any platform dependent code in your program.

9th June 2009, 11:21
Thanks for the information. Can you pls guide me which cross-compiler to be installed in linux and i also already have GCC compiler in my linux machine. Should that be replaced by GCC cross-compiler. Is GCC compiler and cross-compiler are same or we get it in different packages??

Pls do reply.

9th June 2009, 11:28
Why don't you follow the links I gave you?

9th June 2009, 15:54
Why don't you follow the links I gave you?

why dont u give your laptop to him which is preinstalled with every cross compiler and then fly to his house and do the coding and compiling... dont forget to test before leaving:D:D:D

9th June 2009, 16:40
I don't think he knows Polish so my laptop won't do him any good :)

10th June 2009, 02:56
oh man.. he is really out of luck then. :)