LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-04-2004, 04:13 AM   #1
skguha
LQ Newbie
 
Registered: Mar 2004
Posts: 21

Rep: Reputation: 15
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...
 
Old 05-04-2004, 08:40 AM   #2
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
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'
 
Old 05-05-2004, 09:28 PM   #3
skguha
LQ Newbie
 
Registered: Mar 2004
Posts: 21

Original Poster
Rep: Reputation: 15
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...
 
Old 05-06-2004, 07:03 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
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'
 
  


Reply



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
Solved Problem Second GCC-Pass(or gettext sanity check problem) hoes Linux From Scratch 0 09-04-2005 10:20 AM
problem with gcc ptwobrussell Linux - Software 4 09-08-2003 04:58 PM
gcc problem chief Linux - Software 2 07-24-2003 04:23 PM
gcc 3.3 problem darthczyz Linux - Software 6 05-20-2003 10:42 AM
gcc problem nakkaya Linux - Software 5 04-21-2003 05:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:11 AM.

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
Open Source Consulting | Domain Registration