LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2004, 02:58 PM   #1
gamor
Member
 
Registered: Jul 2004
Posts: 77

Rep: Reputation: 15
Getting gcc to work


HI all,
I really need some help here...
I was not sure I had gcc installed with my LInux. So I tried rpm -qa | grep gcc and it gave me:
libgcc-3.2.2-5
So I am assuming I have gcc3.2.2 installed, right ?

When I try to look for it using :
locate */gcc , I get : locate: No match.
ls -l /usr/bin/gcc , I get : ls: /usr/bin/gcc: No such file or directory
find / -name gcc , I get :
find: /lost+found: Permission denied
find: /boot/lost+found: Permission denied
find: /proc/1/fd: Permission denied
find: /proc/2/fd: Permission denied
find: /proc/3/fd: Permission denied
find: /proc/8/fd: Permission denied
find: /proc/4/fd: Permission denied
find: /proc/5/fd: Permission denied
find: /proc/6/fd: Permission denied
find: /proc/7/fd: Permission denied
find: /proc/9/fd: Permission denied
find: /proc/10/fd: Permission denied
find: /proc/14/fd: Permission denied
find: /proc/72/fd: Permission denied
find: /proc/1717/fd: Permission denied
.....

I know I have to change permissions, If you can please tell me how and for what exactely. But , I am not even sure I have gcc because of what I get when I do: locate*/gcc

Also I do not have it in the $PATH
When I do echo $PATH , I get :
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/X11R6/bin

When I vi .bashrc , I get:
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi


Please also tell me how to add gcc to the PATH and whether I need any modification in .bashrc


Please help.
Thanks
 
Old 11-04-2004, 03:12 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
libgcc just means you have the libraries - not the executable.
 
Old 11-04-2004, 03:28 PM   #3
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
What distro/package manager do you use?

# What compiler version do I have installed
gcc -v
gcc --version
# What is the running kernel and compiler installed
cat /proc/version

I have Linux installed, now how do I work some stuff like some software and file managers?
# I can't figure out what software I want and how to install/uninstall it
The table of equivalents, replacements, analogs of Windows software in Linux
# Find software heregenkernel all
Freshmeat
Sourceforge
rpmfind
# Guides to software management
Rute Guide's software explanation
You might want to check out CheckInstall to manage source code installations/uninstallation
# File managers
Midnight Commander
Gentoo file manager
ROX-Filer
# HTML editors
Bluefish
Personally, I use the editor in Midnight Commander when in console and gedit when in X.
Beginners guide: So, you want to make a Web Page!
Anything else you might need
 
Old 11-08-2004, 02:58 PM   #4
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
When I use the command : cat /proc/version I get
Linux version 2.4.20-6 (bhcompile@porky.devel.redhat.com) (gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)) #1 Thu Feb 27 10:06:59 EST 2003

But when I try to get the version of the gcc i have. Iget gcc: command not found. Can only the gcc libraries be installed with Linuc and not the gcc itself?

Thanks
 
Old 11-08-2004, 06:17 PM   #5
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Perhaps telling us what distribution you are running would be of help.

Can you find /usr/bin/gcc (where it installs on both my systems)?

Is /usr/bin in root's or the user's path?

Last edited by fancypiper; 11-08-2004 at 06:18 PM.
 
Old 11-11-2004, 04:14 PM   #6
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
I have been trying to install gcc from scratch but I ran into different other problem.
I have Linux 9.0. I thought it just comes with gcc. I cannot find it. I looked in /usr/bin and gcc ins't there. I have trying to install it from scratch but I am running into different problems. If it is only there and it is a matter of finding it and setting paths, please let me know. I need help.
thanks
 
Old 11-11-2004, 04:57 PM   #7
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Apparently you didn't use the expert install and didn't select the developmetal packages and I can't remember the software tool Red Hat 9.0 uses.

Try this command and see what happens:

yum install gcc

If that doesn't work, or the commands listed below don't help, I suggest installing apt4rpm for a software manager.

# Red Hat & Fedora links
FedoraNEWS.ORG
Red Hat 9 Rescue Mode
The Fedora HOWTO explains the different software managers.
Red Hat Linux Manuals
Get your mp3 support here
Maximum RPM
rpmfind
Easier software management: apt4rpm - Red Carpet

If you install apt4rpm for software management, do these commands:

apt-get update
apt-get dist-upgrade
apt-get install gcc

I have Linux installed, now how do I work some stuff like installing some software?
# I can't figure out what software I want and how to install/uninstall it
The table of equivalents, replacements, analogs of Windows software in Linux
# Find software here
Freshmeat
Sourceforge
rpmfind
# Guides to software management
Rute Guide's software explanation
You might want to check out CheckInstall to manage source code installations/uninstallation
 
Old 11-11-2004, 05:18 PM   #8
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
When I installed redhat, I selected the default option that was recommanded. Can I use the cd to install more packages or isit going to override what I have installed now?
I tried "yum install gcc" and I got : yum: Command not found
I noticed that for most common commands, even for export I get command not found. Is it something with the shell.
I am going to try to install the apt4rpm
I will let you know
 
Old 11-11-2004, 05:25 PM   #9
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
If it's a fresh install, I would re-install using the expert method. You could probably just do upgrade using custom.

Make sure you install kernel-development, kernel-sources and developmental packages.

http://www.redhat.com/docs/manuals/l...stallpath.html
 
Old 11-11-2004, 05:29 PM   #10
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Quote:
Originally posted by gamor
When I installed redhat, I selected the default option that was recommanded. Can I use the cd to install more packages or isit going to override what I have installed now?
I tried "yum install gcc" and I got : yum: Command not found
I noticed that for most common commands, even for export I get command not found. Is it something with the shell.
I am going to try to install the apt4rpm
I will let you know
Remember, to administer your system, you must be root, so in an x-terminal or virtual terminal, if you are logged in as a user, use this command to gain full root power:

su -
<give password>
Now you are root.
Code:
Thu Nov 11 05:28 PM fancy@tinwhistle ~ $ su -
Password:
Thu Nov 11 05:28 PM root@tinwhistle ~ #
Note the change in the prompt.
 
Old 11-11-2004, 06:04 PM   #11
Genesee
Member
 
Registered: Dec 2002
Distribution: Slackware
Posts: 927

Rep: Reputation: 30
redhat has a graphical package add/remove tool, not sure what its called, but its probably in your default kde/gnome desktop menus. you can use that to easily install gcc from your install disks.

iirc there is a section called "development tools" or something similar, in the graphical add/remove window - gcc is definitely on the default install disks, so look around in that section.
 
Old 11-11-2004, 06:09 PM   #12
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 52
if you boot from the CD, you will be asked if you want to make a fresh istallation or update your existing system
 
Old 11-12-2004, 02:04 PM   #13
gamor
Member
 
Registered: Jul 2004
Posts: 77

Original Poster
Rep: Reputation: 15
Yeah I went to add/remove packages in my gnome menu. YOu guys are right, I didn't install teh development tool package nor kernel development. But I don't see the kernel source package.
I am going to installl them from the disc now.
I just have one more question. I am going to need lex or flex. Does it usually come with the developmental package?
I really appreciate all your help.
Thanks a lot
 
Old 11-12-2004, 02:31 PM   #14
fancypiper
LQ Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 58
Doing a Google search gives these Google hits for lex and flex, so it looks as if they are included in the kernel.

If you need to compile a custom kernel or modules for it (nvidia, winmodem, etc), check under /usr/src and see if there is a directrory named linux-<version number> and a symbolic link named linux that points there. If it is missing you need to install it.

The name of the package is kernel-source-<version number and possibly arch here>.rpm.

It can be installed from CD or internet (approx 40 megabytes)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc and cc do not work mlinuxk Linux From Scratch 4 07-29-2005 11:59 AM
How does the gcc-java program work? vdogvictor Programming 4 06-23-2004 12:40 AM
GCC - including <string.h> (won't work) mymojo Linux - Newbie 3 10-17-2003 06:58 PM
gcc -static doesn't work ! tceast Programming 8 09-08-2003 08:15 AM
Getting gcc to work on 3.0 bf2.4 Biren Debian 4 07-21-2003 10:43 PM


All times are GMT -5. The time now is 09:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration