Fixing gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory

When you build cpp files on centos/fedora os, invoke gcc with the following command will through error: gcc: error trying to exec ‘cc1plus’: execvp: No such file or directory,

  gcc -pthread -B /root/miniconda3/envs/sheen-search/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Ireppy/rep-cpp/include -Ireppy/rep-cpp/deps/url-cpp/include -I/root/miniconda3/envs/sheen-search/include/python3.8 -c reppy/rep-cpp/deps/url-cpp/src/psl.cpp -o build/temp.linux-x86_64-cpython-38/reppy/rep-cpp/deps/url-cpp/src/psl.o -std=c++11
  gcc: error trying to exec 'cc1plus': execvp: No such file or directory
  error: command '/usr/bin/gcc' failed with exit code 1

To sove this, for Centos/Fedora, Run the following command to install c++ for gcc:

yum install gcc-c++ 

For ubuntu, run the following command:

sudo apt-get update
sudo apt-get install --reinstall build-essential

Leave a Reply

Your email address will not be published. Required fields are marked *