Re: GCC not working


Subject: Re: GCC not working
From: Black (cpa@ece.cmu.edu)
Date: Fri Nov 10 2000 - 16:01:32 MST


Under Linux (unix, etc...) in order to be able to run an executable, the
system has to be able to know where it is. So, if you just compiled and
got an object file called hello, the system doesn't know that it is
something that you might actually want to run. So, to run it you have two
options. You can call hello using and give it a path so that the kernel
knows where to find the program. If hello is in the same directory as you
are, you can just type ./hello and it should run. The '.' resolves to the
current directory. If it is a program you have written that you want to
run anywhere, you can set your PATH variable so that it points to the
directory that contains the program you wish to run. You can see where
your PATH points to now by typing >echo $PATH. There are various ways to
append new directories to your PATH depending on the shell you are
running. I don't remember what it is under bash, but under tcsh it is just
setenv PATH <new directory>:$PATH

I hope that helps.

-Christopher

On Fri, 10 Nov 2000, Leslie Everett wrote:

>
> On my iMac under YDL I used GCC to create the simple "Hello World!"
> program in C programming language. When I try to run the program by
> typing "hello", I get this error message:
>
> bash: hello: command not found
>
> I've exhausted my limited knowledge of Linux. Any suggestions on how to
> solve this problem? Thanks in advance.
>
> - Leslie Everett
>



This archive was generated by hypermail 2a24 : Fri Nov 10 2000 - 16:01:22 MST