I have been successfully using gcc on Linux Mint 12. Now I am getting an error. I have recently been doing some .so builds and installed Clang not to long ago, but have successfully compiled since both of those events, so not sure what has changed. I used the GUI Software Manager to remove and then install gcc again, but the results are the same:
~/code/c/ut: which gcc
/usr/bin/gcc
~/code/c/ut: gcc -std=c99 -Wall -Wextra -g -c object.c
gcc: error trying to exec 'cc1': execvp: No such file or directory
Make sure your
GCC_EXEC_PREFIX(env)
is not exported and yourPATH
is exported to right tool chain.On Scientific Linux 6 (similar to CentOS 6-- SL is now replaced by CentOS, AIUI), I had to use
/usr/sbin/prelink -av -mR
which I found suggested at https://stelfox.net/blog/2014/08/dependency-prelink-issues/Until I did that, I got a cc1 error
gcc: error trying to exec 'cc1': execvp: No such file or directory
when I tried to compile, and gcc --version reported 4.2.2 instead of 4.4.7, despite that version being reported by yum.It may or may not be related, but the system had run out of space on /var
1. Explanation
The error message told you, that the build-time dependency was not found, so all you need - install the appropriate package to your system (using package manager, build from sources or another way)
What is
cc1
:taken from this answer by Alan Shutko.
2. Solutions
Ubuntu / Linux Mint
Docker-alpine environment
If you are in docker-alpine environment, add this:
to your
Dockerfile
.Taken from github
I experienced this soon after compiling and installing a shiny new GCC — version 8.1 — on RHEL 7. In the end, it ended up being a permissions problem; my root umask was the culprit. I eventually found
cc1
hiding in/usr/local/libexec
:However, the permissions on the directories leading there didn't allow my standard user account:
A quick recursive
chmod
to add world read/execute permissions fixed it right up:And now
gcc
can findcc1
when I ask it to compile something!I fixed this problem by explicitly installing g++:
Problem was encountered on Ubuntu 12.04 while installing pandas. (Thanks perilbrain.)
Since this comes up as the first result on Google, I just wanted to document my experience with Amazon Linux. Installing
gcc-c++.noarch
fixed the problem:sudo yum install gcc-c++.noarch
Some people also reported this alternative as a solution:
sudo yum install gcc72-c++