How to compile a source code in Red Hat linux

LuiLui77
LuiLui77 used Ask the Experts™
on
Hello All,

I am trying to compile a source code in my virtual Red Hat. I tried to do so with the GCC compiler but the terminal returns that "the command is not found". the command line I am issuing is the following: gcc source.c -o outputname

Here is the output of uname -a respectively: "linux machinename 2.4.20-8"

can someone help?

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
yum install gcc c++

Then try your command again

Author

Commented:
This is what I get:
bash: yum :command not found

wierd

Commented:
Install yum from rpm file.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
What is your release?

cat /etc/redhat-release

Open in new window

Author

Commented:
release 9 (Shrike)
Most Valuable Expert 2015

Commented:
You are using a very ancient version of Red-Hat, that hasn't been supported for over a decade, I believe. Get something current. That was a community version of Red-Hat, and the community versions are now Fedora, while Red-Hat itself is commercial, but you can get trial version if you register with Red-Hat, or if you don't want to, then go for CentOS which is community based clone of Red-Hat.
Seth SimmonsSr. Systems Administrator

Commented:
yeah...i paused when i saw the 2.4.20 kernel in the beginning
red hat 9 went end of life in april 2004
time to move on...
Top Expert 2007

Commented:
Is there any particular reason you are using such an old Linux distribution?
Commented:
It was an assignment. I was able to find a gcc compiler by auto-tabbing. The compiler found was gcc296

Thanks to all of you!

Author

Commented:
I have discovered the solution myself. It was the only compiler available.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial