C++ 为什么代码::块在编译C++;文件

C++ 为什么代码::块在编译C++;文件,c++,C++,我以前安装过code::blocks,但在执行hello world程序的过程中从未遇到过任何问题,每个人都必须熟悉这个程序。今天,我将code::blocks与GNU编译器一起安装,并将其添加到PATH(环境变量)中。看起来一切正常,但当我运行以下代码时,它显示了一个错误: #include <iostream> using namespace std; int main() { cout << "Hello world!" <&l

我以前安装过code::blocks,但在执行hello world程序的过程中从未遇到过任何问题,每个人都必须熟悉这个程序。今天,我将code::blocks与GNU编译器一起安装,并将其添加到PATH(环境变量)中。看起来一切正常,但当我运行以下代码时,它显示了一个错误:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
我不太明白这个日志是什么意思。我安装了MinGW,当我转到设置/Compiler时,它显示我正在使用MinGW。一切似乎都很好

以下是我的编辑的截图: .
有人帮我吗?

上面说code::blocks找不到编译器。所以,它自然是无效的。尝试从code::blocks站点卸载code::blocks IDE&安装minGW安装程序。我给这个链接,看看它是否有效。
我也有同样的错误,这是一个环境错误

  • 从Code::Blocks ide下载mingw-setup.exe文件
  • 安装
  • 转到设置->编译器->重置默认值

  • 您是否碰巧在32位版本的windows上运行代码块20.03?您是否考虑过在
    'C:\MinGW/bin/gcc.exe'
    中使路径分隔符保持一致?我不确定,但您可以为此尝试
    C:\MinGW/bin/g++.exe
    ?@DavidC.Rankin我使用的是64位版本的windows,所以我安装了64位版本(文件夹中还有一个GNU编译器)@我不太明白你的意思。我应该如何在code::blocks中设置它?请检查编译器设置。我已经很久没有使用codeblocks了,我记不清了:)我下载了Code::Blocks IDE,发现它与最初的安装是同一个文件。因此,现在我的程序甚至无法运行。我检查了PATH变量,但一切都是正确的。
    Project/Target: "FileTest - 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).