PDA

View Full Version : how to port application made in linux to windows platform



sachinmcajnu
11th March 2011, 09:36
i made a simple application in fedora 14 using qt4 ......and got all the necessary files
including the application file a.out, now since qt4 is known as cross-platform framework
how to port my application to windows

agarny
11th March 2011, 10:05
i made a simple application in fedora 14 using qt4 ......and got all the necessary files
including the application file a.out, now since qt4 is known as cross-platform framework
how to port my application to windowsAs you said and know, Qt is a cross-platform framework, so...

sachinmcajnu
11th March 2011, 10:20
As you said and know, Qt is a cross-platform framework, so...

i didnot understand...........what u said.....

agarny
11th March 2011, 10:22
I meant that because Qt is a cross-platform framework, then if your code works on Linux, then there is a very good chance that it's going to work fine on Windows unless you did something that is specific to the Linux platform. Anyway, the point is: install Qt on Windows and try to compile your application, and you will know.

sachinmcajnu
11th March 2011, 10:34
thank you for the reply
i have a doubt.....if i give some application to my friend that is a.out file will he be able to use it directly by ./a.out
or will he need some qt libraries ..............for it to work

SixDegrees
11th March 2011, 10:36
Transfer your source files to Windows; install Qt for Windows; compile your application under Windows. Unless you've made use of Linux-specific libraries or system calls, everything should work just as it did under Linux.

agarny
11th March 2011, 10:38
First, I am surprised that you are getting an a.out file. This is the name of the binary file that is generated by a compiler when no explicit output name is given. As far as I know, that shouldn't happen with Qt...?

Second, to give the binary file is not sufficient, unless you compiled your Qt application statically, but this is not what is done by default. In other words, you will most likely have to distribute some Qt libraries along with your binary. Personally, to avoid any risk of missing a Qt library, I have a virtual machine with a 'blank' version of Linux on it. From there, I just try my Qt binary and see what is missing and adds it until I get a fully working version.

MarekR22
11th March 2011, 16:57
Probably he compiles manually single source file (g++ ...).
I would recommend to use qmake. Just run:

qmake -project
In directory with source code to generate simple project file (*.pro) (output file name will be based on current directory name).
In this file you can set output file name:

TARGET=someApplicationName
From this point build process will be simple:

qmake
make
In Linux, In Windows replace make with mingw32-make or nmake depending on used compiler.

wysota
11th March 2011, 19:11
There is always a possibility of:
TARGET = a.out
:cool: