I see that same question has been asked many times but my problem is different.
I installed gcc on ubuntu 14.04 and and it works fine with root user. When I attempt to compile using non-root user it throws
error gcc: error trying to exec 'cc1': execvp: No such file or directory
Once I compile the file with root user, non-root user is able to execute the file without any error but it is not able to compile the file.
I suspect there is a problem with file permissions and I have checked permissions for cc1 and non root user had execute permission on the file.
cc1:strace gcc -c foo.c 2>&1 | grep cc1gcc -vreveal ? Please check which gcc binary you're actually running, in case you've somehow installed different gcc versions at different places.-voption might be helpful.build-essential. Try installing it:sudo apt-get install build-essential