Code::Blocks Forums

User forums => Help => Topic started by: BenTzy on January 24, 2013, 05:32:53 pm

Title: iostream No such file in the directory
Post by: BenTzy 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
Title: Re: iostream No such file in the directory
Post by: BlueHazzard 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.
Title: Re: iostream No such file in the directory
Post by: stahta01 on January 25, 2013, 12:07:24 am
Make sure, that your file has the ending ".cpp" and not ".c" or nothing.

http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)

Tim S.
Title: Re: iostream No such file in the directory
Post by: Radek 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.