LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Getting gcc to work (https://www.linuxquestions.org/questions/linux-newbie-8/getting-gcc-to-work-251147/)

gamor 11-04-2004 01:58 PM

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

david_ross 11-04-2004 02:12 PM

libgcc just means you have the libraries - not the executable.

fancypiper 11-04-2004 02:28 PM

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

gamor 11-08-2004 01:58 PM

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

fancypiper 11-08-2004 05:17 PM

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?

gamor 11-11-2004 03:14 PM

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

fancypiper 11-11-2004 03:57 PM

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

gamor 11-11-2004 04:18 PM

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

fancypiper 11-11-2004 04:25 PM

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

fancypiper 11-11-2004 04:29 PM

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.

Genesee 11-11-2004 05:04 PM

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.

perfect_circle 11-11-2004 05:09 PM

if you boot from the CD, you will be asked if you want to make a fresh istallation or update your existing system

gamor 11-12-2004 01:04 PM

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

fancypiper 11-12-2004 01:31 PM

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)


All times are GMT -5. The time now is 03:18 AM.