LinuxQuestions.org

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

kenneth2078 02-11-2010 09:33 AM

gcc installation problem
 
Hi,guys
The command :pm -qa | grep gcc points out that the gcc have been installed.

Use 'which gcc' shows gcc in the path /usr/lib/ccache/gcc ,and more a file named gcc under /usr/bin .

But i can't use gcc , gcc -v command says that no such file or directory. what's wrong with it, please help.

knudfl 02-11-2010 09:50 AM

Fedora : 1) su

2) yum install gcc gcc-c++ glibc-headers glibc-devel

.. will install gcc and the files required to use it.


rpm -qa | grep <package-name> ( or part of name )
is telling, what is installed.

( Only /usr/bin/gcc will be usable, and then only if you
also have the two "glibc" development packages mentioned.)
.....

kenneth2078 02-11-2010 11:11 AM

Quote:

Originally Posted by knudfl (Post 3860394)
Fedora : 1) su

2) yum install gcc gcc-c++ glibc-headers glibc-devel

.. will install gcc and the files required to use it.


rpm -qa | grep <package-name> ( or part of name )
is telling, what is installed.

( Only /usr/bin/gcc will be usable, and then only if you
also have the two "glibc" development packages mentioned.)
.....

Hi, I do it as you wrote above, but still the gcc isn't work .

By the way i made the gcc file under /usr/bin/ by ln -s /usr/lib/ccache/gcc, which may lead to the problem , i guess.

David1357 02-11-2010 11:44 AM

Quote:

Originally Posted by kenneth2078 (Post 3860379)
what's wrong with it, please help.

What is the output of "echo $PATH"? Is "/usr/bin" in your path?

knudfl 02-11-2010 12:47 PM

And ccache is not the compiler ( /usr/lib/ccache/* ) :
ccache is a compiler cache. It acts as a caching pre-processor
to C/C++ compilers, using the -E compiler switch and a hash to
detect when a compilation can be satisfied from cache. This
often results in a 5 to 10 times speedup in common compilations.
( ccache-2.4-16.fc12.i686 )

So please delete the link, you made.

1) echo $PATH , as said by @ David1357
2) Try this command : /usr/bin/gcc -v
3) And show the output from : rpm -qa gcc
.....

kenneth2078 02-11-2010 10:01 PM

Quote:

Originally Posted by David1357 (Post 3860496)
What is the output of "echo $PATH"? Is "/usr/bin" in your path?


echo $PATH output: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin: /usr/local/bin:/sbin:/bin:/usr/bin:/usr/lib/ccahce/:/root/bin

kenneth2078 02-11-2010 10:08 PM

Quote:

Originally Posted by knudfl (Post 3860555)
And ccache is not the compiler ( /usr/lib/ccache/* ) :
ccache is a compiler cache. It acts as a caching pre-processor
to C/C++ compilers, using the -E compiler switch and a hash to
detect when a compilation can be satisfied from cache. This
often results in a 5 to 10 times speedup in common compilations.
( ccache-2.4-16.fc12.i686 )

So please delete the link, you made.

1) echo $PATH , as said by @ David1357

2) Try this command : /usr/bin/gcc -v
No such file or directory

3) And show the output from : rpm -qa gcc
gcc-4.3.0-8.i386

.....

please see my reply in red.

evo2 02-11-2010 10:10 PM

What about

Code:

file /usr/bin/gcc
Evo2.

chrism01 02-11-2010 11:09 PM

Please post your distro & version.
In any case seems like an rpm based system, so try this

yum groupinstall "Development Tools"

from http://www.cyberciti.biz/faq/rhel-ce...command-howto/. you may need the groupremove option there first. I'd also remove that symlink first as noted above.

IOW:

1. remove symlink
2. yum groupremove "Development Tools"
3. yum clean all
4. yum groupinstall "Development Tools"

kenneth2078 02-12-2010 03:13 AM

Quote:

Originally Posted by evo2 (Post 3861040)
What about

Code:

file /usr/bin/gcc
Evo2.

/usr/bin/gcc:ERROR:can not open '/usr/bin/gcc',no such file or directory.
And I once had deleted the gcc file in /usr/bin, if the the correct gcc rebuilt, the problem would be solved.

evo2 02-12-2010 03:26 AM

Quote:

Originally Posted by kenneth2078 (Post 3861242)
/usr/bin/gcc:ERROR:can not open '/usr/bin/gcc',no such file or directory.
And I once had deleted the gcc file in /usr/bin, if the the correct gcc rebuilt, the problem would be solved.

Hmm, I suggest you reinstall the package.

EDIT: Follow steps 2 - 4 in chrism01 post #9

Evo2.

kenneth2078 02-12-2010 06:18 AM

Quote:

Originally Posted by evo2 (Post 3861251)
Hmm, I suggest you reinstall the package.

EDIT: Follow steps 2 - 4 in chrism01 post #9

Evo2.

Your are right.!!


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