473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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 3513
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Mike Dee | last post by:
A very very basic UTF-8 question that's driving me nuts: If I have this in the beginning of my Python script in Linux: #!/usr/bin/env python # -*- coding: UTF-8 -*- should I - or should I...
383
by: John Bailo | last post by:
The war of the OSes was won a long time ago. Unix has always been, and will continue to be, the Server OS in the form of Linux. Microsoft struggled mightily to win that battle -- creating a...
9
by: John Eric Hanson | last post by:
My company is considering a development path in which we develop code on 32 bit Windows machines to run remotely on 64 bit Linux machines. What could go wrong?
4
by: John Owens | last post by:
Hi, I'm looking for a plugin for Visual Studio .NET or another IDE etc that would allow me to develop on Windows but have the compiler and debugger and code run on Linux. e.g. Code using...
4
by: Tim Golden | last post by:
Tim Golden enlightened us with: > > Well, I'm with you. I'm sure a lot of people will chime in to point > > out just how flexible and useful and productive Linux is as a > > workstation, but every...
3
by: A.M | last post by:
Hi, I am planning to develop python applications on windows and run them on Linux. Are ActivePython scripts compatible with Linux? Is there any guideline that explains the compatibility...
7
by: VijaKhara | last post by:
Hi, I am given source codes written using C. The writer told me that he wrote on Linux. Now I am trying to compile and run it on Windows. There are many errors shown up. Are there any...
4
by: peter | last post by:
I've come across a weird difference between the behaviour of the Tkinter checkbox in Windows and Linux. The issue became apparent in some code I wrote to display an image in a fixed size canvas...
7
by: Lior | last post by:
Hi, I have small code, that compiles on Visual C++ into a shared library (DLL). I need to compile it under linux, but the code includes some data types I'm not familiar with, such as DWORD,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.