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;
    cin.get();
    return 0;
}

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

Member Avatar for r.stiltskin

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.

Member Avatar for r.stiltskin

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:
http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler

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.

Member Avatar for r.stiltskin

Oops. Sorry about that -- I only looked at the Linux distro.

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 ?

start new thread seeing that this thread have white hair in it ;)

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

commented: Thanks a lot! +0

the auto detect solved the problem, thanks a lot

the auto detect solved the problem, thanks a lot

Mark it so then!

thanks for the help. audodetect solved it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.