Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Trying to get first C program on Unix to run

OK. I'm on a mac powerbook running os x (jaguar ed) and am trying to get my first c program to run. It is an extremely simple program and it seems to have compiled using both the cc and gcc commands (I don't know which to use). This is the source code. I use vi as my editor.

#include
int main()
{
printf("goodbye cruel world.
");
}

The program seems to compile. When I do an ls the source file goodbye.c and the executable (at least I think it is an executable) goodbye are both listed. When I compile it it just runs and there are no errors. When I run goodbye it says command not found. What gives? The command I am using is cc -g -o goodbye goodbye.c

Thanks,

CZ

Comments

  • VirtuousVirtuous Member Posts: 4
    Try using ./goodbye at the command prompt to execute your proggy.
    Virt


    : OK. I'm on a mac powerbook running os x (jaguar ed) and am trying to get my first c program to run. It is an extremely simple program and it seems to have compiled using both the cc and gcc commands (I don't know which to use). This is the source code. I use vi as my editor.
    :
    : #include
    : int main()
    : {
    : printf("goodbye cruel world.
    ");
    : }
    :
    : The program seems to compile. When I do an ls the source file goodbye.c and the executable (at least I think it is an executable) goodbye are both listed. When I compile it it just runs and there are no errors. When I run goodbye it says command not found. What gives? The command I am using is cc -g -o goodbye goodbye.c
    :
    : Thanks,
    :
    : CZ
    :
    :

Sign In or Register to comment.