This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Newbie - gcc apparently not building obj file
- To: help-gcc at gnu dot org
- Subject: Re: Newbie - gcc apparently not building obj file
- From: d_cary at my-deja dot com
- Date: Wed, 05 Jan 2000 17:13:56 GMT
- Newsgroups: gnu.gcc.help
- Organization: Deja.com
- References: <PKwc4.1195$WM5.26589@dfiatx1-snr1.gtei.net>
- Xref: wodc7nx0 gnu.gcc.help:2360
The first thing you need to do is
ls -l
to make sure that gcc is really creating the output file ``hello'',
and setting the "executable" bit (there should be a "x" in the
permissions column of the listing for ``hello'', but a '-' in the same
column for ``hello.c'').
On my machine, I used to have to type
./hello
to execute a program in the current directory. My sysadmin claims it's
a "security feature". Without the ``./'', my machine looks in the
(supposedly "secure") locations for executables ( my ``path'' includes
lots of directories that end in ``/bin/'' ). When it doesn't find it
there, I get the ``command not found'' message. Don't tell him I added
the "./" directory to the end of my path.
By the way, folks around here use the term ``object file'' to talk
about (non-executable) intermediate files sometimes generated by the
compiler (if you use the -c option) and ending with the extension
``.o''.
Richard De Berry <deberryr@yahoo.com>, in frustration, wrote:
> I enter
> gcc -o hello hello.c
...
>, then
> hello
...
> I get a command not found message.
Sent via Deja.com http://www.deja.com/
Before you buy.