Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc: cannot execute 'cc1plus'

Tags:

c++

g++

mingw

I have just downloaded the C++ compiler MinGW, checked everything in the MinGW Installation Manager, and put the \bin location. But when I test the compiler in one of my C++ compilers, I get the following error:

gcc: fatal error: cannot execute 'cc1plus': CreateProcess: No such file or directory
compilation terminated.

I would appreciate it if I would get an idea on how to fix the compiler!

like image 287
anonymous Avatar asked Feb 06 '26 08:02

anonymous


2 Answers

Install gcc-c++ or g++, and then set the environment variable. You can also run g++ -v to check whether g++ was installed correctly or not.

like image 156
Allen Zhu Avatar answered Feb 09 '26 00:02

Allen Zhu


Had this error recently while setting up cpp env in ubuntu. Turned out I had multiple versions of g++ installed. Got help from this thread. Using type -a g++ command I was able to locate the executables for g++

Output:

g++ is ~/x86_64-linux-musl-native/bin/g++
g++ is ~/x86_64-linux-musl-native/bin/g++
g++ is /usr/bin/g++
g++ is /bin/g++

Besides running any the binaries, I was able to get the file to compile using g++-11 main.cpp -o output

like image 29
Koji D'infinte Avatar answered Feb 08 '26 23:02

Koji D'infinte