Problems with gcc

Jim Van Zandt jrv at mbunix.mitre.org
Wed Aug 24 13:08:06 EDT 1994


In message <9408240226.AA17504 at misty.suffolk.edu> you write:
>
>I suddenly seem to be having problems with gcc as far as executing programs.
>I compiled the simple program hello.c successfuly with no errors. But when
>I go to run it with "a.out" I get a "command not found" message.
>
>Vin Cocco
>Suffolk University     email:  cocco at misty.suffok.edu

(1) Try "./a.out" instead (specifying the path to the program).  I assume 
that will work, so

(2) Type "set | grep PATH" and see whether the current directory "." is
in the path.  It should *not* be in the path for root (that would open
a security hole), but *should* be in the path for an ordinary user.
Alternatively, type "which a.out" to find out the path to the program
to be executed, or the list of directories searched.

(3) Some shells (csh but not bash, I think) cache references to
executables to save directory accesses, and you may have to type
"rehash" to refresh the cache.

(4) You should be doing ordinary program development and test using a
regular user account, and only use "root" to install them (moving files
to /usr/bin and /usr/man/man?).

                 - Jim Van Zandt <jrv at vanzandt.mv.com>




More information about the Discuss mailing list