LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   gcc problem (https://www.linuxquestions.org/questions/linux-software-2/gcc-problem-177643/)

skguha 05-04-2004 04:13 AM

gcc problem
 
Hi,

I am new to linux n using fedora 9. I am trying to use gcc but it says
Quote:

bash: gcc: command not found
But when i type
Quote:

rpm -q gcc
the response i get is
Quote:

gcc-3.3.3-2.0.0
What shud i do to make gcc work?? If i have to set path, then how do i go about it? Please explain as u wud to a newbie...

Thanks...

Oliv' 05-04-2004 08:40 AM

Hello,

It seems to be a PATH problem, so to find where gcc is installed you can type this command (It may take a very long time):
Code:

find / -name gcc
Then try to run gcc with full path (ie /usr/bin/gcc). If that works it means it was really a PATH problem. So add the missing PATH to your environnement variable:
Code:

export PATH=$PATH:/my/gcc/path
To make it permanent, add the previous line in your ~/.bashrc for example.

Oliv'

skguha 05-05-2004 09:28 PM

The results of find / -name gcc are
Quote:

[root@beenb eng11104]# find / -name gcc
/usr/src/debug/gcc-3.2.3-20030505/gcc
/usr/src/debug/gcc-3.2.3-20030505/obj-i386-redhat-linux/gcc
/usr/src/debug/gcc-3.3.2-20031023/gcc
/usr/src/debug/gcc-3.3.2-20031023/obj-i386-redhat-linux/gcc
/home/eng11104/gcc
/home/eng11104/gcc/gcc
/openpkg/bin/gcc
/openpkg/include/gcc
Now what shud i do to see if it is installed or how do i run it using the full path......i am new to linux so pls state explicitly....

Thanks...

Oliv' 05-06-2004 07:03 AM

Well, for example to compile hello.c into hello, do:
Code:

/openpkg/bin/gcc -o hello hello.c
Or you can try:
Code:

export PATH=$PATH:/openpkg/bin
gcc -o hello hello.c

Oliv'


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