3
votes

I want to run a Qt application in Linux which is compiled on Windows using Qt Creator.

I tried googling but I did not get any answers regarding Qt creator. I found for Visual studio. Can anyone please let me know if this can be done in Qt Creator in Windows7 ? Do I need to install any other compilers ?

Thanks in advance.

2
Yes you need to install a cross compiler that works on Windows but generates Linux executables. - Some programmer dude
Thank you sir for a quick reply. Can you please help a little bit more by letting me know which cross compiler is a better option and where can I download. I am actually new to this. - Sid
Why do you want to do that? Why not install Linux on your machine? - Basile Starynkevitch

2 Answers

8
votes

If you don't want to install Linux, I think the best way is using a Virtual Machine. That's because even if the source code compiles for Linux, how could it be verified to run? You will need a real target environment to finally test your application.

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.

You can install Qt on the installed Linux, copy your project there, compile it and see the results in the real environment. This way you can cope with the minor differences when porting from one OS to another easily.

0
votes
  • I have installed Qt for Ubuntu Linux in my virtual machine. The file that I have used is qt-opensource-linux-x86-5.3.1.run.
    • I installed g++ and other dependent libraries in Ubuntu as compiler for Qt was not available in this installation file.
    • Then I took the Qt project file that was build in Windows and build the same in Ubuntu.

Thanks and regards Sid