Author Topic: iostream No such file in the directory  (Read 26409 times)

BenTzy

  • Guest
iostream No such file in the directory
« on: January 24, 2013, 05:32:53 pm »
Hello
I just downloaded  Code::Blocks 8.02 and I am typing a simple code from the beginning of my Starting with C++ Early Objects txt book to test everything before moving on and when I build the code I get an error

C:\Users\Kohel... 2 fatal error: iostream: No such file or directory

Line 2 is as simple as

#include <iostream>

I know that the #include directive causes the preprocessor to include the contents of another file in the program. The word iostream is the name of the file. Becouse the program uses cout to display screen output the header file  iostream file must be included. Why am I recieving an error stating No such file?
Thank you

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: iostream No such file in the directory
« Reply #1 on: January 24, 2013, 10:10:18 pm »
Hello
c::B 8.02 is very old! Use 12.11 instead ( http://www.codeblocks.org/downloads/binaries ) !
What OS do you use? What compiler? Can you post the full compiler log?
Make sure, that your file has the ending ".cpp" and not ".c" or nothing.
« Last Edit: January 24, 2013, 10:12:05 pm by BlueHazzard »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: iostream No such file in the directory
« Reply #3 on: January 25, 2013, 08:42:52 am »
iostream is a very basic C++ header which should be present everywhere where is C++. Check your include path, it might happen somehow that C++ headers vanished from it. Another possibility is that you are using a very old C++ compiler which comes from times, when there were no "iostream" and similar headers (only iostream.h, iostream.hpp and so on). Search your disk for file "iostream" (no extent). If you find none then consider installing more contemporary C++. Less likely, you might have installed a pure C instead of C++ but in this case, you should not be able to compile a C++ program at all.