can i run linux code on windows

S

sachin dooble

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.
 
A

agarwal.prateek

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/
 
P

Philip Paeps

sachin dooble said:
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
(e-mail address removed) I follow the newsgroup.

BOFH Excuse #130:
new management
 
D

Das

sachin said:
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 :(
 
J

Jaspreet

sachin said:
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.
 
E

Emmanuel Delahaye

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?"
 
A

Alexei A. Frounze

sachin dooble said:
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
 
J

John Bode

sachin said:
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.
 
I

Ian Gay

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.
 
K

Keith Thompson

Ian Gay said:
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.
 
R

Randy Howard

Keith Thompson wrote
(in article said:
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.
 
E

ed_davis2

sachin said:
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?
 
K

Keith Thompson

ed_davis2 said:
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.
 
E

ed_davis2

Keith said:
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 :)
 
C

Chris Hills

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.
 
D

Das

John said:
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 ;)
 
W

Walter Roberson

John Bode wrote:
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".
 
F

Flash Gordon

Walter said:
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.
 
A

Alexei A. Frounze

....
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
 
D

Das

Alexei said:
...

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,169
Messages
2,570,915
Members
47,456
Latest member
JavierWalp

Latest Threads

Top