LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   converting .out file to .exe file (http://www.linuxquestions.org/questions/linux-newbie-8/converting-out-file-to-exe-file-806311/)

mgnidhi_3july 05-06-2010 09:29 AM

converting .out file to .exe file
 
Hi all,
In our linux OS server i've created one small C application,after compiling i got a.out file which is a executable fiel in Linux platform.But i want that application should run in my pc so can anyone tell how to convert that .out to .exe so that i can run that application on my windows xp OS???

thanks in advance,
Sri

MrCode 05-06-2010 09:33 AM

Well, assuming your code is cross-platform to begin with (i.e. is not dependent on Linux-specific libraries or system calls), you would need to recompile the program for Windows. AFAIK there's no way of directly converting a POSIX executable to Windows format...

pixellany 05-06-2010 09:35 AM

To run on Windows, you would have to compile it for Windows---using the Windows headers, etc.

You cannot just "convert the file".

mgnidhi_3july 05-06-2010 09:38 AM

could you plz tel in simple words??
 
Hi Mr.Code,
I'm a newbie to linux if you say such technical terms it makes me confuse.so in simple way whats the procedure for converting .out to .exe file???

thanks and regards,
Sri
Quote:

Originally Posted by MrCode (Post 3959279)
Well, assuming your code is cross-platform to begin with (i.e. is not dependent on Linux-specific libraries or system calls), you would need to recompile the program for Windows. AFAIK there's no way of directly converting a POSIX executable to Windows format...


mgnidhi_3july 05-06-2010 09:39 AM

could u tel me the procedures for the same??
 
Hi,
could u tel me the procedures for the same??

thanks and regards,
Sri

Quote:

Originally Posted by pixellany (Post 3959280)
To run on Windows, you would have to compile it for Windows---using the Windows headers, etc.

You cannot just "convert the file".


MrCode 05-06-2010 09:40 AM

Quote:

in simple way whats the procedure for converting .out to .exe file???
There's no way of doing it directly. The executable formats for Linux and Windows are vastly different from each other. It's that simple; you would need to compile the program for Windows.

pixellany 05-06-2010 09:44 AM

Quote:

Originally Posted by mgnidhi_3july (Post 3959285)
Hi,
could u tel me the procedures for the same??

thanks and regards,
Sri

Since you compiled it for Linux, I assume you know the basic procedure for compiling a program.

To compile for Windows, you need to set up a Windows development environment (which will include all the appropriate headers).

Please give us some context for your question....for example, it this a school project?

brianL 05-06-2010 09:55 AM

Cross-compiling on Linux for Windows:
http://www.google.co.uk/search?q=cro...ient=firefox-a

John VV 05-06-2010 02:48 PM

Quote:

Since you compiled it for Linux, I assume you know the basic procedure for compiling a program.
i do not think so
seeing as it is a ???.a file

and the op wants a MS W.exe :banghead::banghead::banghead:

the .a gcc output is a "hello world" from a few years back

mgnidhi_3july 05-07-2010 12:29 AM

Cross compiling to Windows
 
Hi Brian,
Thanks you very much about that topic Cross Compiling.I was really not knowing about that.But i've a question for you..i hav a cygwin in my pc(windows OS) and my source code is in another m/c(linux OS).Can i directly compile that source code in cygwin without modifying even a single line??
suppose in my source code,
long emp_mobNo[1000];
int extn_No[1000];
char emp_name[1000][50];
int i=0;
FILE *fp;
const char file[] = "/home/dbg/Sri/dataFolder/intoFile.txt";

the bold one is showing the path i'm referring for my file operation.this small application is working fine in linux if i run a.out file.But i want that application has to run on windows.So please suggest...

thanks and regards,
Sri
Quote:

Originally Posted by brianL (Post 3959301)
Cross-compiling on Linux for Windows:
http://www.google.co.uk/search?q=cro...ient=firefox-a


mgnidhi_3july 05-07-2010 12:31 AM

help mi with this
 
Hi,
i've a question for you..i hav cygwin in my pc(windows OS) and my source code is in another m/c(linux OS).Can i directly compile that source code in cygwin without modifying even a single line??
suppose in my source code,
long emp_mobNo[1000];
int extn_No[1000];
char emp_name[1000][50];
int i=0;
FILE *fp;
const char file[] = "/home/dbg/Sri/dataFolder/intoFile.txt";

the bold one is showing the path i'm referring for my file operation.this small application is working fine in linux if i run a.out file.But i want that application has to run on windows.So please suggest...

thanks and regards,
Sri
Quote:

Originally Posted by pixellany (Post 3959291)
Since you compiled it for Linux, I assume you know the basic procedure for compiling a program.

To compile for Windows, you need to set up a Windows development environment (which will include all the appropriate headers).

Please give us some context for your question....for example, it this a school project?


John VV 05-07-2010 03:48 AM

Quote:

Can i directly compile that source code in cygwin without modifying even a single line??
a big maybe ???
cygwin will build a LINUX file on windows ( an NOT a win.exe )
but it only builds about 75 to 80 % of programs , and only about 50% without hacking the code.

MinGW will however build a Win.exe FROM linux code ( again for about 75 % of the code will build )

both can be installed ( even with MS VisualStudio ) i have these 3 installed on XP
but this can be a pain in "the out know what" at times


All times are GMT -5. The time now is 07:15 AM.