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]

Re: Newbie - gcc apparently not building obj file




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.

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