Ask Your Question

gcc: error trying to exec 'cc1'

asked 2015-11-21 16:48:11 -0500

elya5 gravatar image

updated 2015-11-30 10:28:12 -0500

If I execute gcc, I always get the error: gcc: error trying to exec 'cc1': execvp: no such file or directory. I'm on Fedora 23 and I have gcc version 5.1.1 installed. The file /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/cc1 exists. Does anyone know what's wrong?

edit retag flag offensive close merge delete


You may want to use strace to hunt this issue down. Running strace -e trace=%process gcc may be what you need. Have a look at man strace for details.

genodeftest gravatar imagegenodeftest ( 2018-08-21 13:21:24 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-08-20 14:02:42 -0500

I had the same issue trying to compile things in the 'fish' shell. Running bash and repeating the make command made it work correctly. I haven't figured out exactly why this is, but I've gotten used to getting weird results when not running bash.

In fish the output of gcc -print-prog-name=cc1 is just cc1

in bash it's


edit flag offensive delete link more

answered 2015-11-25 04:45:12 -0500


cc1 is included in cpp

[casep@t400 ~]$ rpm -ql cpp

You need to have cpp installed (should be installed at the same time as gcc in a normal dnf installation...)

edit flag offensive delete link more


I have /usr/libexec/gcc/x86_64-redhat-linux/5.1.1/cc1 but apparently gcc cannot find it.

elya5 gravatar imageelya5 ( 2015-11-28 06:45:31 -0500 )edit

Hi, what's the output of

[casep@X201t ~]$ gcc -print-prog-name=cc1

Also any chance that GCC_EXEC_PREFIX is defined somewhere in the shell or in the script?

Kind regards

casep gravatar imagecasep ( 2015-11-30 11:02:06 -0500 )edit

The output is cc1 and I did not change the prefix knowingly.

elya5 gravatar imageelya5 ( 2015-11-30 15:54:59 -0500 )edit

Question Tools

1 follower


Asked: 2015-11-21 16:48:11 -0500

Seen: 1,358 times

Last updated: Aug 20 '18