469,354 Members | 2,149 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

can i run linux code on windows

is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.

Nov 15 '05 #1
21 3274
Yes you can. You have to recompile the source. Linux executables cannot
be executed in windows. Using libraries and some changes one can
recompile the source
Refer:
http://cygwin.com/

Nov 15 '05 #2
sachin dooble <sa***********@gmail.com> wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


If your 'code' is plain C and you have a compiler for Microsoft, you should
have no problems compiling the code and running it.

If all you have is the binary, you're SOL.

- Philip

--
Philip Paeps Please don't email any replies
ph****@paeps.cx I follow the newsgroup.

BOFH Excuse #130:
new management
Nov 15 '05 #3
Das

sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.

yes That is the hardest way arround. If you know how windows executes
and how linux executes then you can try to interprete the linux
executable(ELF) and make it into windows executable(PE). but there will
be issues for runtime library support, so what you will you do???

Moreover why you are interested to demote linux executables :(

Nov 15 '05 #4

sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


Sachin, I don't think you can simply run your a.out on windows.
Assuming its a C-code all you need to do is to recompile it on windows
platform and execute it. C is not like JAVA where you can run your java
class file on any platform.

Nov 15 '05 #5
sachin dooble wrote on 02/08/05 :
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


No way. BTW, this is not a C-question.

To be back to C, portability exists, but at source level. The code must
be recompiled according to the target.

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

I once asked an expert COBOL programmer, how to
declare local variables in COBOL, the reply was:
"what is a local variable?"
Nov 15 '05 #6
"sachin dooble" <sa***********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


This's OT. Anyway, generally, the answer is no. But if you have some spare
$$$, get VMWare or Virtual PC. If you don't have, get Bochs. Those are
virtual machines that work under windows and inside them you can install and
run any x86 OS.

Alex
Nov 15 '05 #7

sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

Nov 15 '05 #8
"John Bode" <jo*******@my-deja.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:

sachin dooble wrote:
is there any method where i can run my linux code that is all the
a.out i made on linux to run on windows.
plz tell me the way.


You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

But since this is comp.lang.c, I assume you have source code in c. So
get a windows compiler and re-compile it. mingw is a nice free windows
version of gcc.
--
*** To reply by e-mail, make double u single in address ***
Nov 15 '05 #9
Ian Gay <ga*@sfuu.ca> writes:
"John Bode" <jo*******@my-deja.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:

sachin dooble wrote:
is there any method where i can run my linux code that is all the
a.out i made on linux to run on windows.
plz tell me the way.


You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

But since this is comp.lang.c, I assume you have source code in c. So
get a windows compiler and re-compile it. mingw is a nice free windows
version of gcc.


But unless the source code is extremely portable, it probably won't
compile under both Windows and Linux.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #10
Keith Thompson wrote
(in article <ln************@nuthaus.mib.org>):
Ian Gay <ga*@sfuu.ca> writes:
"John Bode" <jo*******@my-deja.com> wrote in
news:11*********************@g49g2000cwa.googlegro ups.com:

sachin dooble wrote:
is there any method where i can run my linux code that is all the
a.out i made on linux to run on windows.
plz tell me the way.

You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

But since this is comp.lang.c, I assume you have source code in c. So
get a windows compiler and re-compile it. mingw is a nice free windows
version of gcc.


But unless the source code is extremely portable, it probably won't
compile under both Windows and Linux.


Strange, almost everything I have that's written in C will. C++
code is a different story, particularly if it's GUI code.

--
Randy Howard (2reply remove FOOBAR)

Nov 15 '05 #11
sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


You could try colinux (at colinux.com). It runs Linux as a task under
Windows. Not exactly what you were asking, but it does let you run
your Linux code under Windows (under Linux), which is kinda/sorta the
same thing, maybe/almost?

Nov 15 '05 #12
"ed_davis2" <ed*******@yahoo.com> writes:
sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


You could try colinux (at colinux.com). It runs Linux as a task under
Windows. Not exactly what you were asking, but it does let you run
your Linux code under Windows (under Linux), which is kinda/sorta the
same thing, maybe/almost?


First, this is off-topic,

Second, you should try colinux.org unless you're interested in Lau Gar
Kung Fu.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Nov 15 '05 #13
Keith Thompson wrote:
"ed_davis2" <ed*******@yahoo.com> writes:
sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


You could try colinux (at colinux.com). It runs Linux as a task under
Windows. Not exactly what you were asking, but it does let you run
your Linux code under Windows (under Linux), which is kinda/sorta the
same thing, maybe/almost?


First, this is off-topic,

Second, you should try colinux.org unless you're interested in Lau Gar
Kung Fu.


Whoops! Yes, I've accidentally been there a couple or three times
myself... Thanks for the correction, even if it is off-topic :-)

Nov 15 '05 #14
In article <11**********************@g44g2000cwa.googlegroups .com>,
sachin dooble <sa***********@gmail.com> writes
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


The answer is "maybe" A lot of it should be portable between Linux and
Windows. However it depends on the library calls you make. Also it wil
depend on weather it is command line to talking to a GUI.
--
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\/\/\/\/\ Chris Hills Staffs England /\/\/\/\/
/\/\/ ch***@phaedsys.org www.phaedsys.org \/\/\
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/

Nov 15 '05 #15
Das
John Bode wrote:
sachin dooble wrote:
is there any method where i can run my linux code that is all the a.out
i made on linux to run on windows.
plz tell me the way.


You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.
Well it might be Extreamly difficult but I think it is Possible.
Alex You Write OS So you can guide him if he is interested to go the
hardest way. Who knows He might be the next Linus ;)

Nov 15 '05 #16
In article <11**********************@g47g2000cwa.googlegroups .com>,
Das <as*********@gmail.com> wrote:
John Bode wrote:
You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.


Wine requires that the code be recompiled with the Wine libraries.
Most people would not count that as having the "executable" run "natively".
--
Entropy is the logarithm of probability -- Boltzmann
Nov 15 '05 #17
Walter Roberson wrote:
In article <11**********************@g47g2000cwa.googlegroups .com>,
Das <as*********@gmail.com> wrote:
John Bode wrote:

You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.


Wine requires that the code be recompiled with the Wine libraries.
Most people would not count that as having the "executable" run "natively".


<OT>
No it does not. Or at least, not always. I know this having run SW I
only had Windows binaries for such as Agent from Forte Inc.
</OT>

Another example of why off topic stuff should not be discussed just
redirected.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Nov 15 '05 #18
"Das" <as*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
....
Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.
Well it might be Extreamly difficult but I think it is Possible.
Alex You Write OS So you can guide him if he is interested to go the
hardest way. Who knows He might be the next Linus ;)


The thing is, apart running x86 code on x86 CPU (be this code linux
executable or linux -- doesn't matter) one needs to provide this code with
the expected environment which this code needs. Hence, although it's all
possible to run 90% of code natively (to the degree x86 CPU allows that
since it wasn't designed with the emulation in mind), the rest has to be
mimicked anyway. And it's a good question whether linux/windows emulation is
easier then emulation of the entire x86 PC. :) Possible != available (not
now, at least :).

Alex
Nov 15 '05 #19
Das

Alexei A. Frounze wrote:
"Das" <as*********@gmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
...
Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.
Well it might be Extreamly difficult but I think it is Possible.
Alex You Write OS So you can guide him if he is interested to go the
hardest way. Who knows He might be the next Linus ;)
The thing is, apart running x86 code on x86 CPU (be this code linux
executable or linux -- doesn't matter) one needs to provide this code with
the expected environment which this code needs. Hence, although it's all
possible to run 90% of code natively (to the degree x86 CPU allows that
since it wasn't designed with the emulation in mind), the rest has to be
mimicked anyway. And it's a good question whether linux/windows emulation is
easier then emulation of the entire x86 PC. :) Possible != available (not
now, at least :).


yes you are right... People like you Should guide Newcomers. Thanks
Alex.

Alex


Nov 15 '05 #20
On 5 Aug 2005 09:18:53 -0700, Das
<as*********@gmail.com> wrote:
John Bode wrote:
sachin dooble wrote:
> is there any method where i can run my linux code that is all the a.out
> i made on linux to run on windows.
> plz tell me the way.


You'll need something like VMWare. AFAIK, there's no way to make a
Linux executable run under Windows natively.

Why You guys say no way??? if Wine can run Windoze code under linux A
similar system can be developed to run Linux Codes under Windows.
Well it might be Extreamly difficult but I think it is Possible.
Alex You Write OS So you can guide him if he is interested to go the
hardest way. Who knows He might be the next Linus ;)


If you want to do it you do it. But not in comp.lang.c where it is off
topic (a comp.os.* group would seem appropriate, possibly something
with Windows in the name). "Extremely difficult" means "costs a lot of
time and/or money", so unless there is an actual demand for it no one is
going to bother to write it (and if only one person wants it and they
don't want to write it themself they'll have to pay someone to write it
for them -- my rates start at around GBP 40 per hour (plus VAT))...

Chris C
Nov 15 '05 #21
"Chris Croughton" <ch***@keristor.net> wrote in message
news:sl******************@ccserver.keris.net...
....
for them -- my rates start at around GBP 40 per hour (plus VAT))...


Not bad. :)

Alex
Nov 15 '05 #22

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by John Eric Hanson | last post: by
4 posts views Thread by John Owens | last post: by
4 posts views Thread by Tim Golden | last post: by
7 posts views Thread by Lior | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.