Why is the 'iostream.h' file not found ?

Dear CLion Community,

I'm trying to teach myself C/C++ Game Programming. Mostly as a hobby, but hopefully more seriously; should I be successful in learning (and/or mastering) this programming language. I'm very happy with the new CLion IDE (from my limited technical experience). I've also been downloading free open source games from different websites on the Internet, but whenever I copy and paste them to CLion to compile and/or examine the code, CLion gives me this error:


iostream.h file not found

I'm curious to know what's the solution for this, or any other similar issue ?
Screen Shot 2015-11-28 at 1.16.20 PM.png
Thanks !

2 comments
Comment actions Permalink

Hi Frederick!

Sorry for the delay. In general, STL doesn't have "iostream.h", only "iostream". So your implementation of STL (it seems to be libc++ as you're on OS X) doesn't have it. Does that help?

0
Comment actions Permalink

There is only iostream in the header files,so you should write like following:
#include<iostream>
and the difference between <> and "" is that if you include the standard header files, you can use both <> and ""
but if you include a header file you created, you can only use "".
Just like
#include<iostream> //iostream is the standard header file.
#include"iostream" //it works
#include"hello.h"     //hello.h is the header file I created
#Include<hello.h>   //it doesn't work
that is the rule you have to follow when including header files

0

Please sign in to leave a comment.