Results 1 to 10 of 11
I have a simple C program compiled in ubuntu and an excution file is produced. I wonder how can I put it in window and run it. Anyway can I ...
- 07-02-2011 #1Just Joined!
- Join Date
- Jun 2011
- Posts
- 10
A beginner problem
I have a simple C program compiled in ubuntu and an excution file is produced. I wonder how can I put it in window and run it. Anyway can I run this program in Window?
Thank you.
- 07-02-2011 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,975
You can open a terminal window and run it there.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-02-2011 #3Just Joined!
- Join Date
- Jun 2011
- Posts
- 10
But can I run it in Window XP? I tried double click but it doesn't work
- 07-02-2011 #4
Never tried doing that one, but you'll more than likely need a compiler for XP to run it.
If you compile a program for one OS... that's what you gotta run it on.
Somebody, please... correct me if I am wrong.Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.
- 07-02-2011 #5Just Joined!
- Join Date
- Jun 2011
- Posts
- 10
Thank you. I see the problem now. Any compiler that is suitable to compile a C program in Windows OS ?
- 07-02-2011 #6
Disclaimer: I am not a developer.
But for what itīs worth:
Gcc has windows targets Host/Target specific installation notes for GCC - GNU Project - Free Software Foundation (FSF)
There is gcc for windows included here MinGW | Minimalist GNU for Windows
Probably it pays to use a native windows compiler, but this has for sure even more consequences in terms of platform independent coding.You must always face the curtain with a bow.
- 07-02-2011 #7Linux Guru
- Join Date
- May 2011
- Posts
- 1,855
Just adding to what Irithori said, i use the GNU GCC compiler that comes with the Cygwin environment a lot and it usually works just fine (on simple C code). Note that this is not a trivial solution, you have to install the entire environment to use GCC, but if you (have to) do Linuxy stuff a lot in Windows, then I highly recommend Cygwin.
- 07-02-2011 #8Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,975
No. Programs compile on Linux generally will not run in Windows. You can get the mingw gcc compiler for Windows and recompile it there in order to run it under XP.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 07-03-2011 #9Just Joined!
- Join Date
- May 2011
- Posts
- 4
- 07-04-2011 #10Linux User
- Join Date
- Jan 2005
- Location
- Saint Paul, MN
- Posts
- 262
Due to differences in the OS API, Libraries, and binary format, a executable binary can not be run on Windows when compiled on Linux on Windows.
However if the C program is written in ANSII C and you have a C compiler on Windows, you can transfer the source and build your program there and then execute.
Note: The above was assume being on the same hardware. If different hardware, then recomiling is must even if using the same OS as the instructions understood by the processor are or may be different.
Think about having a semi-truck load of stuff and then asking can I carry this load in Honda Insite? it just is not likely even of attempting to make multiple trips.


1Likes
Reply With Quote
