Code blocks has problems

May 9, 2013 at 8:39am
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;
}
May 9, 2013 at 9:52am
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.
May 10, 2013 at 10:22pm
So how can i fix it?
i already tried reinstalling code blocks
May 10, 2013 at 11:23pm
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.
May 11, 2013 at 10:46am
dude, i don't even know what the complier is.
May 11, 2013 at 11:09am
go to google and download latest dev c++ compiler and program there
May 11, 2013 at 1:07pm
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.