【发布时间】:2021-02-25 01:23:15
【问题描述】:
所以我最近刚刚下载了一个名为 Code::Blocks 的 C++ IDE 并创建了一个新项目。但是当我尝试构建并运行它时,代码给出了一些错误。我知道这不是语法或类似问题的问题,因为我运行了 Code::Blocks 提供的默认代码。错误如下:
Project/Target: "firstcpp - Debug":
The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?!
Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Tried to run compiler executable 'C:\MinGW/bin/gcc.exe', but failed!
Skipping...
Nothing to be done (all items are up-to-date).
在我看来,C++ 编译器存在某种问题,但我认为 Code::Blocks 已经带有 C++ 编译器,所以我不太确定这里有什么问题。我也按照他们的指示去Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables,但我不太清楚他们所说的fix the compiler 是什么意思。这是我所看到的屏幕截图:
如果你需要,这里还有我电脑上的信息:
在这一点上,我不太确定如何解决这个问题。这个问题我问过我的朋友(他们已经成功下载并使用了Code::Blocks),他们说他们在安装的时候从来没有遇到过这个问题。
【问题讨论】:
-
我可能会说这是一个非常有趣的问题。看来你的编译器不见了
-
@drescherjm 不。我必须下载任何东西才能获得它吗?
-
@drescherjm 哦,我以为 Code::Blocks 是编译器自带的。我问了我的朋友,他们说他们不需要安装额外的编译器,它对他们有用。
-
Good instructions for installing an up-to-date mingw。这个发行版带有一个令人印象深刻的预建附加库生态系统,您可以安装和使用。如果您希望在程序中获得诸如 boost 或 SSL 支持之类的功能,可以为您节省大量时间。
-
有多个下载文件:codeblocks-20.03-setup.exe (IDE 无编译器 ~ 30 MB); codeblocks-20.03mingw-setup.exe (IDE + MinGW ~ 90 MB); codeblocks-20.03mingw-32bit-setup.exe(IDE + MinGW + 编译为 32 位应用程序)。确保得到正确的。如果有问题,请删除已安装的版本,然后安装新版本。这是最简单的做法。
标签: c++ gcc compiler-errors codeblocks