Thursday, April 1, 2010

error trying to exec 'cc1': execvp: No such file or directory

I ran into this error when I had more than one version of gcc installed on my machine. I had multiple versions because, compilation of some open source softwares required a gcc of 3.x.x version. I messed things up completely because some other software required gcc-4.x.x as I was playing around with sym links

You could however, run into this problem in several other ways too.

The first thing you would do to fix this problem is to reinstall gcc and g++. On a ubuntu machine, you'd do it by
$apt-get remove gcc g++
$apt-get install gcc g++

If you still face the same problem (as I did), try installing a different version of gcc and g++, say:
$apt-get install gcc-4.1 g++-4.1

If you use other linux distributions, use the corresponding command-line software installers i.e., yum (fedora), yast(suse) etc.,

Fortunately, that did the trick for me.

No comments:

Post a Comment