I had almost the same error messag:
gcc: error trying to exec 'cc1': execvp: No such file or directory
I googled and arrived here. So for the sake of helping people with my same problem... My error was in a different context: trying to compile a go program importing the go-sqlite3 driver...
in my case (ubuntu 16.10 yakkety yak)
sudo find /usr/ -name cc1 showed me that cc1 was installed, even several versions:
I did run
which gcc and could see that gcc was pointing to my nvidia cuda driver bin directory, which was including gcc...
In my case this was some residual stuff I didn't uninstall properly, so I had to manually remove that directory from my
$PATH in my
.bashrc. The I closed my terminal (I've could have run
source ~/.bashrc), verified with
which gcc that it was pointing to the proper one (
/usr/bin/gcc) tried to recompile my go program and it worked without any errors this time.
I know this may not be the perfect answer, but it may point a perso having the same error message to investigate further this kind of stuff.
Of course check which version of gcc you are using, and install the "companion" g++ you need. In my case it was:
g++-4.9 (already installed).