How to make a *.c file into a executive file?

Sandeep M. Yelwatkar sandeep@veritas.com
Fri Oct 1 07:39:00 GMT 1999


ok, here is a simple and short program which you can try, and learn.

create a file "try.c" using any editor with following contents
.
#include <stdio.h>
main()
{
    printf("Hello World\n");
}

save it and execute the following commands.

$ gcc try.c

This will produce an executable file a.out in the same directory.
then execute the command
$ a.out
To see the following printed on the terminal.
Hello World
$
In case a.out command fails, you probably need to try the following
command.
$./a.out

ok
Regards.
Sandeep


Liu Ningyu wrote:

>     I just stated to learn GCC.
>     Who can tell me some typical command lines under UNIX to compile ,
> link a *.c file and make it executive?
>     Thank you.



More information about the Gcc-help mailing list