Find the answer to your Linux question:
Results 1 to 6 of 6
Hi I'm new in this forum, I would like to know what can i do to make my program in C an executable file. I tried with $ gcc test.c ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2

    Exclamation After compile (gcc) create .exe

    Hi I'm new in this forum, I would like to know what can i do to make my program in C an executable file.
    I tried with
    $ gcc test.c -o test.exe
    $ ./test.exe

    then it runs. But when i do double click on window file (test.exe) it doesn't run.
    please help me...

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    welcome to the forum

    two points:
    1. in *nix no such extension as ".exe" is necessary
    2. there is a "test" command builtinto the bash shell--
    that will be run, not yr program. So use some
    other name--and no ".exe"
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    2
    Quote Originally Posted by tpl View Post
    welcome to the forum

    two points:
    1. in *nix no such extension as ".exe" is necessary
    2. there is a "test" command builtinto the bash shell--
    that will be run, not yr program. So use some
    other name--and no ".exe"
    thank you for your answer.
    But i want to make my program ".exe" because i want run it in windows Xp.

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2006
    Posts
    631
    You can't run a program in windows if it's compiled for Linux, you have to compile it in your windows environment.

    Regards

  5. #5
    Just Joined!
    Join Date
    Sep 2004
    Posts
    5
    Or you could try a cross-compile: Cross compiler - Wikipedia, the free encyclopedia

  6. #6
    Just Joined!
    Join Date
    Sep 2007
    Posts
    5

    What's your environment: OS, GNUish, etc.?

    Are you running Cygwin on Windows?

    The file you compiled and linked is running when you double click, but it has no input, nor command line parameters, because you are invoking it from Windows Explorer.

    If you don't understand Windows & you don't understand UNIX/GNU, then you have a long, rock hard row to hoe.

    You need to run it from a shell, if you're compiling with gcc & you need Cygwin to do this.

    Go to Cygwin Information and Installation, read the documentation and decide what you need to do from there, including: (a) calling a knowledgeable GNU/UNIX/Linux/Cygwin friend, or (b) giving up!

    Cygwin is an emulation layer/environment/program suite that lets you run and develop programs as if Windows were a GNU/Linux OS. Questions about that environment are inappropriate, here.

    At the very least the 'gcc' compiler and libraries "expects/needs" a GNUish environment, and Cygwin provides that for Windoze. Cygwin is a very good rendition of GNU, but you must know and understand GNU before using it. (As well as the differences of Windows.) You don't seem to.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...