gcc:无法执行“cc1plus”

问题描述 投票:0回答:2

我刚刚下载了 C++ 编译器 MinGW,检查了 MinGW Installation Manager 中的所有内容,并将其放入位置。但是当我在我的 C++ 编译器之一中测试编译器时,出现以下错误:

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

如果我能了解如何修复编译器,我将不胜感激!

c++ g++ mingw
2个回答
18
投票

安装gcc-c++或g++,然后设置环境变量。 您还可以运行

g++ -v
检查 g++ 是否安装正确。


0
投票

最近在 ubuntu 中设置 cpp env 时遇到此错误。结果我安装了多个版本的 g++。从此线程获得帮助。使用

type -a g++
命令我能够找到 g++

的可执行文件

输出:

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++
© www.soinside.com 2019 - 2024. All rights reserved.