LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 05-06-2010, 08:29 AM   #1
mgnidhi_3july
LQ Newbie
 
Registered: May 2010
Posts: 23

Rep: Reputation: 15
Unhappy 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
 
Old 05-06-2010, 08:33 AM   #2
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
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...
 
Old 05-06-2010, 08:35 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

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

You cannot just "convert the file".
 
Old 05-06-2010, 08:38 AM   #4
mgnidhi_3july
LQ Newbie
 
Registered: May 2010
Posts: 23

Original Poster
Rep: Reputation: 15
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 View Post
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...
 
Old 05-06-2010, 08:39 AM   #5
mgnidhi_3july
LQ Newbie
 
Registered: May 2010
Posts: 23

Original Poster
Rep: Reputation: 15
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 View Post
To run on Windows, you would have to compile it for Windows---using the Windows headers, etc.

You cannot just "convert the file".
 
Old 05-06-2010, 08:40 AM   #6
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
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.
 
Old 05-06-2010, 08:44 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by mgnidhi_3july View Post
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?
 
Old 05-06-2010, 08:55 AM   #8
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 6,963
Blog Entries: 52

Rep: Reputation: Disabled
Cross-compiling on Linux for Windows:
http://www.google.co.uk/search?q=cro...ient=firefox-a
 
1 members found this post helpful.
Old 05-06-2010, 01:48 PM   #9
John VV
Guru
 
Registered: Aug 2005
Posts: 12,834

Rep: Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709
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

the .a gcc output is a "hello world" from a few years back
 
0 members found this post helpful.
Old 05-06-2010, 11:29 PM   #10
mgnidhi_3july
LQ Newbie
 
Registered: May 2010
Posts: 23

Original Poster
Rep: Reputation: 15
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 View Post
Cross-compiling on Linux for Windows:
http://www.google.co.uk/search?q=cro...ient=firefox-a
 
Old 05-06-2010, 11:31 PM   #11
mgnidhi_3july
LQ Newbie
 
Registered: May 2010
Posts: 23

Original Poster
Rep: Reputation: 15
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 View Post
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?
 
Old 05-07-2010, 02:48 AM   #12
John VV
Guru
 
Registered: Aug 2005
Posts: 12,834

Rep: Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709Reputation: 1709
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
 
  


Reply

Tags
converting, exe, file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Converting a HTML file to a PNG file through Python script TheIndependentAquarius Programming 12 02-02-2010 10:10 AM
converting text file to a cmd file no.4 Linux - Newbie 3 04-10-2008 11:45 AM
converting into file.tar.gz file ? kapsikum General 2 03-21-2005 12:33 AM
renaming or converting a text file to a dat file... tangaz Linux - Software 1 10-24-2003 06:57 AM
What do I need to run a .exe file? Ekim Gram Linux - Newbie 4 05-09-2003 07:16 AM


All times are GMT -5. The time now is 10:51 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration