This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bamboozled --a newbie dilemma



hi everyone,

I apologize for the newbieness of this question.

My ISP is a Unix system, specifically a Sun OS. The c compiler is is GNU CC
version 2.7.2.

I wrote the following program:


 #include <stdio.h>

 void main()
 {
      printf("Goodbye, cruel world!\n");
 }


I name it

goodbye.C

and put it in a .C directory

then used the following command to compile it:

g++ goodbye.C

I get no error messages and end up with a

goodbye.C

file and also an

a.out

file and those are the only files in my directory. I then type in

goodbye

to execute it, and nothing happens except the following message:

goodbye: Command not found

I've tried calling the file

goodbye.cpp
goodbye.c

I've tried  it with just " main() " in the code instead of
void main()

I've also included

return 0;

after the
printf("Hello, world\n");

what am I doing wrong?

Thanx kindly for any and all help anyone may offer'
Dave



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]