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 ...
- 09-08-2007 #1Just Joined!
- Join Date
- Sep 2007
- Posts
- 2
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...
- 09-08-2007 #2Linux 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)
- 09-09-2007 #3Just Joined!
- Join Date
- Sep 2007
- Posts
- 2
- 09-09-2007 #4Linux 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
- 09-12-2007 #5Just Joined!
- Join Date
- Sep 2004
- Posts
- 5
Or you could try a cross-compile: Cross compiler - Wikipedia, the free encyclopedia
- 09-12-2007 #6Just 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.


Reply With Quote
