Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have installed g++ and gcc from repository on ubuntu 12.04 ad you can see that they are indeed installed

mahmood@pc:~$ dpkg -l | grep gcc
ii  gcc-4.4                                4.4.7-1ubuntu2                          GNU C compiler
ii  gcc-4.4-base                           4.4.7-1ubuntu2                          GCC, the GNU Compiler Collection (base package)
ii  gcc-4.4-multilib                       4.4.7-1ubuntu2                          GNU C compiler (multilib files)
ii  gcc-4.6-base                           4.6.3-1ubuntu5                          GCC, the GNU Compiler Collection (base package)
ii  lib32gcc1                              1:4.6.3-1ubuntu5                        GCC support library (32 bit Version)
ii  libgcc1                                1:4.6.3-1ubuntu5                        GCC support library
ii  libgcc1-dbg                            1:4.6.3-1ubuntu5                        GCC support library (debug symbols)

mahmood@pc:~$ dpkg -l | grep g++
ii  g++-4.4                                4.4.7-1ubuntu2                          GNU C++ compiler
ii  g++-4.4-multilib                       4.4.7-1ubuntu2                          GNU C++ compiler (multilib files)

However when I run gcc or g++ commands, it says they are not installed

mahmood@pc:~$ g++
The program 'g++' can be found in the following packages:
 * g++
 * pentium-builder
Try: sudo apt-get install <selected package>

mahmood@pc:~$ gcc
The program 'gcc' can be found in the following packages:
 * gcc
 * pentium-builder
Try: sudo apt-get install <selected package>

What did I miss??

share|improve this question
    
I'm facing a similar problem with Eclipse. The command eclipse cannot find the installed program. I thought this might be an issue with setting the PATH variable but that hasn't helped. –  Shruti Jun 12 '13 at 14:52
add comment

2 Answers

up vote 2 down vote accepted

You don't have the packages gcc and g++ installed.

This packages contain the files /usr/bin/gcc and /usr/bin/g++ while the package gcc-4.4 contains /usr/bin/gcc-4.4 and the package g++-4.4 contains /usr/bin/g++-4.4.

share|improve this answer
add comment

I had a similar issue with Eclipse. It was solved by adding a symbolic link in the /usr/local/bin folder. So first change to the folder: cd /usr/local/bin then add a symbolic link: ln -s <folder where actual program is located>.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.