.exe works across ms & linux? - Questions

This is a discussion on .exe works across ms & linux? - Questions ; if a program written in a high level language (turbo c/turbo pascal, etc) works on a microsoft operating system (win2000/xp, etc), will the same ..exe or .obj also work on a standard linux operating system? or does the program have ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: .exe works across ms & linux?

  1. .exe works across ms & linux?

    if a program written in a high level language (turbo c/turbo pascal, etc)
    works on a microsoft operating system (win2000/xp, etc), will the same
    ..exe or .obj also work on a standard linux operating system? or does
    the program have to be written/compiled specifically for linux? thx in
    advance.

  2. Re: .exe works across ms & linux?

    On 5 Nov 2003 08:43:00 -0800, milhous451 wrote:
    > if a program written in a high level language (turbo c/turbo pascal, etc)
    > works on a microsoft operating system (win2000/xp, etc), will the same
    > .exe or .obj also work on a standard linux operating system? or does
    > the program have to be written/compiled specifically for linux? thx in
    > advance.


    Most computer language programs need to be compiled/linked on the OS which
    they are to run. Exception are shell programs or something which runs
    under an interpreter like java or basic.

    The next problem is if the code uses system calls only found on one OS.

  3. Re: .exe works across ms & linux?

    milhous451 wrote:

    > if a program written in a high level language (turbo c/turbo pascal, etc)
    > works on a microsoft operating system (win2000/xp, etc), will the same
    > .exe or .obj also work on a standard linux operating system?


    No and yes.
    No, a Windows .EXE or .OBJ file is not directly compatable with Linux, and
    cannot be directly executed on a Linux system,
    Yes, with tools like 'wine' (http://www.winehq.org/), Microsoft .EXE
    executables can be run in an emulated Windows environment on a suitable
    Linux system

    > or does
    > the program have to be written/compiled specifically for linux?


    That's the preferred approach. It guarantees that the program is compatable
    with Linux, and negates the requirement for additional, non-standard support
    tools.

    > thx in
    > advance.



    --
    Lew Pitcher, IT Consultant, Application Architecture
    Enterprise Technology Solutions, TD Bank Financial Group

    (Opinions expressed here are my own, not my employer's)


  4. Re: .exe works across ms & linux?

    milhous451 wrote:

    > will the same
    > .exe or .obj also work on a standard linux operating system?


    .... not directly
    ..
    --
    /// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
    \\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
    'I believe in getting into hot water; it keeps you clean."
    -- G. K. Chesterton


  5. Re: .exe works across ms & linux?

    milhous451 wrote:

    > if a program written in a high level language (turbo c/turbo pascal, etc)
    > works on a microsoft operating system (win2000/xp, etc), will the same
    > .exe or .obj also work on a standard linux operating system? or does
    > the program have to be written/compiled specifically for linux? thx in
    > advance.


    You have 2 options.
    1: Run the exe in Linux under wine A Windows emulator
    2: Re-write the program for the linux environment
    You cant just recompile a windows program, the api is entirely
    different. The windows provided functions you call to do the bulk
    of the work in windows just dont exist in Linux.

    If your program uses only libc calls and nothing windows specific and it
    runs in a dos box, doesnt create any windows, then you might be able to
    just recompile it to run in a linux console. Even then, 99.9% of the time
    your going to have to make at least minimal changes (like adding or
    removing include files, excuse me units (I think in C, dont know a whole
    lot about pascal))to make it compile in a Linux/Unix environment to say the
    very least. But havin said all that, I encourage you to persue it. Even if
    it doesnt work you will learn a lot about how the two environments differ
    as you try to iron out the roadblocks.
    Eric

+ Reply to Thread