Re: gcc on Linux 8.0 not working
- From: Marc Schwartz <marc_schwartz@xxxxxxxxxxx>
- Date: Mon, 18 Jun 2007 14:07:02 -0500
General Schvantzkoph <schvantzkoph@xxxxxxxxx> writes:
On Mon, 18 Jun 2007 09:36:26 -0700, Tom Gear wrote:
I just purchased Red Hat Linux 8 Bible by Chris Negus, used. I loaded
Linux 8.0 with the purpose of learning C via Kernigan and Ritchie,
Linux, and Nasm. I didn't install any GUI, I'm going to work in the
shell.
I installed "developer tools" , and wrote the Hello World program
verbatim from K&R in my home directory. When I type "gcc hello.c", no
error messages appear, and a.out appears in the current directory.
But, when I try to run Hello, world by typing "a.out", the shell
returns:
-bash no command a.out found
or something very close to that, I'm not sitting at that computer right
now.
I tried changing the name of a.out, and it still doesn't work.
Tom Gear
Do you have your local directory (.) in your search path? Also what are
the permissions on a.out? Do a chmod +x a.out and see if that fixes your
problem.
When executing a program in the local directory which in not in the $PATH,
as noted above, you need to use:
./a.out
That is, precede the name of the executable with "./", which tells Linux
where to find the executable.
This is a security feature, which makes it more difficult (though not
impossible) to execute malicious programs that you may have downloaded.
BTW, as others will likely note, RH 8.0 has long been a dead product. The RH
releases have been superceded by Fedora which is now up to version 7.
More information is available here:
http://fedoraproject.org/
HTH,
Marc Schwartz
.
- References:
- gcc on Linux 8.0 not working
- From: Tom Gear
- Re: gcc on Linux 8.0 not working
- From: General Schvantzkoph
- gcc on Linux 8.0 not working
- Prev by Date: Re: gcc on Linux 8.0 not working
- Next by Date: Re: Cannot find any linux partitions - rescue mode
- Previous by thread: Re: gcc on Linux 8.0 not working
- Index(es):