Hello, I'm 100% new to C++ and someone recommend Code::Blocks as the best IDE for coding in this language.

However when I try to run my code:

#include <iostream>

using namespace std;

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

I get the following error:
"1. Factorial Number - Debug" uses an invalid compiler. Skipping...
Nothing to be done.

8 Years
Discussion Span
Last Post by corey_2

Click on Project/Build Options/Debug & see if Gnu GCC Compiler is selected.

Also (maybe a dumb question) did you actually install the Gnu GCC compiler? (It's not included in the Code::Blocks distribution, afaik.)


Yes, I already stated in the thread title that GNU GCC compiler was selected.

I haven't manually installed the GNU GCC Compiler because I thought it came pre-included in the Code::Blocks program.

Should I manually install it? I'll wait for other opinions before breaking my set-up.


I checked -- the Code::Blocks distro definitely doesn't include a compiler. It clearly sounds like you don't have one installed. If you've never actually installed a compiler, it's pretty definite that you don't have one -- Windows certainly doesn't come with a compiler built-in, and neither do most Linux distributions.

Search your disk for "gcc". Chances are you won't find it, and obviously will have to install it. This will help you configure Code::Blocks afterwards:


codeblocks-8.02-setup.exe 28 Feb 2008 10.8 MB
codeblocks-8.02mingw-setup.exe 28 Feb 2008 19.3 MB
The first one is the IDE only
The second (larger one) includes the compiler.

You need the second one only once (unless you manually install compiler(s) of your choice). Then if you want to keep up to date with the IDE, you then get increments of the first.


hey yall....followed all your instructions ...even dowloaded the codeblocks which already has a compiler...but stiil won't compile...any settings that i need to do before running my code?


Could you help me to solve this problem at Code::Blocks ?
The message is : Debug" uses an invalid compiler. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...
What should I do ?


to solve the problem u can
1.go to setting
2.choose compiler and debugger
3choose toolchain executables
4.click auto detect
i dont know if it does not work 4 u but it work 4 me

Thanks a lot!
This article has been dead for over six months. Start a new discussion instead.
Be sure to adhere to our posting rules.