LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-26-2005, 01:58 AM   #1
sateeshgalla
LQ Newbie
 
Registered: Apr 2005
Location: Bangalore
Posts: 16

Rep: Reputation: 0
How to run Linux application on Windows


Hi all,

I want to know whether can i write an application C program on linux, and able to execute on Windows.

Please tell me what is the procedure to this.

Thanks in Advance.

Sateesh Galla.
 
Old 08-26-2005, 02:03 AM   #2
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
There is no way to directly run applications compiled for Linux in Windows.

Cygwin is an environment in Windows which provides all the Linux tools and system calls. You can recomplie Linux applications in Cygwin and then they will run in Cygwin.

Otherwise, you can run Linux inside an emulator.
 
Old 08-26-2005, 02:24 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
You can also write a portable application in C by using libraries available on both sides, and compile one binary version for each target O/S and architecture.

A simpler way would be to use a portable language like Java.
 
Old 08-26-2005, 06:29 AM   #4
boxerboy
Member
 
Registered: Jul 2005
Distribution: ubuntu5.04, ubuntu5.10, suse9.3, mandrake10.1, mandriva2006(beta), FC1-4, redhat9.0, debian sarge
Posts: 519

Rep: Reputation: 32
Quote:
. Individual packages like bash, gcc, less, etc. are released independently of the DLL.
if im reading that right i would have to download a gcc and bash to beable to compile and run a program using Cygwin?
 
Old 08-26-2005, 10:12 AM   #5
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
to answer boxerboy's question, that's useful for not having to re-install cygwin (and inherantly - everything) to get a minor update for 'less'.
_____________

on the machine level shouldn't 'hello-world' work on both os's (because it is not calling any outside dll/ shared lib or kernal dependant code). considering how efficient gcc versus vs6/.net is, shouldn't the byte code they generate be similar.
has anyone compared the hex code/ assembly instructions created on both platforms for 'hello-world'?
i never tried this but i assume it to be true (x86 is x86 regardless of the operating system).

is there anything wrong with my theory?
schneidz

Last edited by schneidz; 08-26-2005 at 10:26 AM.
 
Old 08-26-2005, 10:43 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
is there anything wrong with my theory?
I'm not at all a Win32 expert, but here are some areas where differences will probably (or certainly) destroy your theory:
executable file format
relocation
dynamic linking method
function calling conventions
CPU register usage
memory model
interruption handling
...

Go with Java or an interpreted language instead
 
Old 08-26-2005, 10:55 AM   #7
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i never considered those os layer tasks, they are so transparent you don't really think of it much.

well java cheats in that it is not multi-platform. it works on only one platform (jvm). in order to run programs you will have to install a jvm specific to each platform.
doesn't this add more overhead as in another layer of translation/ interpreting (more clock cycles)?

not a big fan of the java,
 
Old 08-26-2005, 11:45 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
well java cheats in that it is not multi-platform. it works on only one platform (jvm). in order to run programs you will have to install a jvm specific to each platform.
That's no specific to Java, it is simply the only way to provide binary portability whatever the underlying platform is.
Same could be said to interpreted languages, which need a runtime too.

Quote:
doesn't this add more overhead as in another layer of translation/ interpreting (more clock cycles)?
It adds some overhead, undoubtly.
Whether this has a visible impact on perceived performance depend on many other factors.
Quote:
not a big fan of the java,
You should reconsider that, Java used to be somewhat sluggish at the beginning, but with modern versions, the on the fly compilation make difference fade vs native code.

For example, I'm working since a couple of weeks ago with a free, open source 3D modeler, with ray tracing rendering in full java (Art Of Illusion). Manipulating a bunch of complex 3D objects is impressivly fast and show a good sample of what java is able to do now.

Last edited by jlliagre; 08-26-2005 at 03:19 PM.
 
Old 08-26-2005, 02:31 PM   #9
exvor
Senior Member
 
Registered: Jul 2004
Location: Phoenix, Arizona
Distribution: Gentoo, LFS, Debian,Ubuntu
Posts: 1,537

Rep: Reputation: 87
I tend to still find java apps slow but hey gtk apps are slow like that as well :P


Phex is a good example of java programming. its not really slow ither.
 
Old 08-26-2005, 11:10 PM   #10
randyding
Member
 
Registered: May 2004
Posts: 552

Rep: Reputation: 31
Take a look at trollteck QT designer. We use it for all our GUIs.
The customers love it too. Windows, Linux, Solaris, very nice.
You do have to compile the app for each target to create the executables,
its rarely a problem... depending on what you're trying to do.
http://www.trolltech.com/products/qt/index.html
 
  


Reply



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
run windows application & games pareshbhangale Linux - Newbie 2 06-28-2004 06:19 PM
how i migrate windows application to Linux base application vandarakalpesh Linux - Software 0 06-26-2004 03:34 AM
how to run a windows application one linux chris_law Linux - Software 7 10-09-2003 11:53 PM
How to run Windows Application in linux !! hitesh_linux Linux - General 7 01-15-2003 05:01 PM
what windows application do you run with wine etc Alexop Linux - General 3 08-21-2002 04:54 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:48 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration