Tag Archives: Daily bug resolution

[Solved] gcc: error trying to exec ‘cc1‘: execvp: No such file or directory

An execution error occurred after installing GCC An error occurred while loading the C file

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

After adding environment variables

whereis cc1

Find out where CC1 is

/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/cc1

Position of CC1 in my centos7

If you can’t find it

locate cc1

Once found, copy

/usr/libexec/gcc/x86_64-redhat-linux/4.8.2

then

PATH="$PATH":/usr/libexec/gcc/x86_64-redhat-linux/4.8.2

Import environment variables

export PATH

That’s it