Code blocks has problems

I tried the first code in the c++ tutorial but after building it it says "fatalerror: iostream: no such file or directory". Please help me. i really want to program other stuff quickly.
cheers.

here's the code if you need it.

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
cout << "Hello World!";
return 0;
}
The error is clear: the iostream header file, which is part of standard library, is not in any of the directories that the compiler is looking from. Being standard heaser, it should be included as part of the compiler installation. Either the installation or configuration has errors (or the compiler version is too old to include that header).

The problem is not in your code.
So how can i fix it?
i already tried reinstalling code blocks
check you mingw installation or any other compiler supported by code::blocks, and make sure code::blocks knows where ther are, you can google that, its as easy as 1+x=0.

Aceix.
dude, i don't even know what the complier is.
go to google and download latest dev c++ compiler and program there
1. Make sure the name of the file ends with the extension .cpp , not .c
The compiler usually auto detects whether to use a c or c++ compiler depending on the file type. Since you are writing C++ code, you need a C++ compiler, therefore name the file "something.cpp".

2. code::blocks should work just fine. If you wanted to try an alternative, then the Orwell devc++ is the latest version.
http://www.codeblocks.org/
http://orwelldevcpp.blogspot.com/

Topic archived. No new replies allowed.