advertisement

Article:
  Learning the Mac OS X Terminal: Part 1
Subject:   behavior of cc in OS X terminal window
Date:   2001-12-21 17:03:42
From:   pistor
I have a question regarding the c compiler. When I write a c program hello.c and compile it like this


[localhost:~] myname% cc hello.c


I find the executable file called a.out in the same directory. When I try to run a.out by typing:


[localhost:~] myname% cc hello.c


I receive the following message:


a.out: Command not found.


when I go a directory level up by typing:


[localhost:~] myname% cd ..


and call the program then by typing:


[localhost:~] myname% directoryname/a.out


the program executes correctly. Is this how the terminal is supposed to act and why is this. Why can't a command be found when I am in the same directory as the executable file?


thanks for any suggestions


christoph



1 to 1 of 1
  1. behavior of cc in OS X terminal window
    2001-12-21 20:24:42  hokanstenholm [View]

1 to 1 of 1