iostream.h: no such file in directory

Oct 9, 2011 at 10:15pm
Hi,

I've been using codeblocks and have even tried Visual C++ 2010 Express and niether of them seem to have the header file iostream. I use to use it with mingw gcc, but I'd much rather use a program like codoblocks or Visual C++. Could anyone explain to me how to use that header file with codeblock, or guide me to another debugger/compliler program that includes iostream?

Any help, explanation or walk through of what I need to do, would be greatly appreciated. I would happily pay you or send you beer for helping me with this if (yourAge >= 21).

Steve
Oct 9, 2011 at 10:41pm
It's <iostream>, not <iostream.h>
Oct 10, 2011 at 2:07am
ya I support the Disch answer.It's #include<iostream> ,not #include<iostream.h>
Oct 10, 2011 at 6:53am
Thanks, but that was the first thing I tried. I'm pretty sure the only difference there is whether 'iostream' is a local file or not. It doesn't work either way. Does the header file work for any of you? If so, what program are you using?
Oct 10, 2011 at 7:57am
I'm pretty sure the only difference there is whether 'iostream' is a local file or not.


That is incorrect. iostream.h and iostream are different files with different names, and they have different internals (the most obvious of which is namespaces). Modern compilers don't come with iostream.h

If your compiler cannot find iostream, then it's broken in some way. Maybe installed incorrectly, maybe it does not have the include paths set up.
Last edited on Oct 10, 2011 at 7:58am
Oct 10, 2011 at 7:25pm
sorry, I guess codeblocks is taking it as iostream, but cout, cin and endl aren't declared in iostream. I opened iostream and I see it in there and have no idea why it's not taking cin or cout.
Oct 10, 2011 at 7:55pm
It's because they're in the std namespace.

Either use std::cin and std::cout, or put using namespace std; after your includes.
Oct 10, 2011 at 8:05pm
Wow, It freekin works! Why doesn't the text book mention that? Well, it was published in 2001. Thanks a bunch!
Oct 10, 2011 at 8:10pm
Yeah that's the problem with outdated learning materials.

FWIW, the previous standard came out in 2003, so anything published before that probably isn't worth reading.

And I say previous standard because the latest just came out this year.
Oct 10, 2011 at 9:31pm
Do you recommend any updated learning materials? Everything that I find on Amazon seems to be at least a few years old.
Topic archived. No new replies allowed.