'I can't compile c++ program in code blocks. It gives me error

In code blocks when I am running program (single Hello world program).

Here is code:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

It gave me an error:

Project/Target: "test - 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/mingw32-gcc.exe', but failed!

Skipping...
Nothing to be done (all items are up-to-date).


Solution 1:[1]

You have to download the mingw setup, that includes a compiler with your IDE

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Steven