Fatal error: iostream: no such file or directory | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Fatal error: iostream: no such file or directory

Hey, when I make my first hello world program and try to build and run in code blocks, it gives me 1 error and it's Fatal error: iostream: no such file or directory. How can I solve this?

23rd Jul 2020, 9:38 AM
Youssef Hossam
Youssef Hossam - avatar
25 Answers
0
You have to add path - https://code.visualstudio.com/docs/cpp/config-mingw Read 4. Add the path..... if you don't have mingw install it 3. If you still have problems, you can try visual studio by Microsoft, they have own compiler that will automatically install along with the IDE write g++ --version in the command line
23rd Jul 2020, 12:04 PM
Kry$tof
+ 4
May be you have created c project instead of cpp that's why it giving error. If u didn't getting error watch this video may be it will help you. https://youtu.be/rSGQOcR7a3E
24th Jul 2020, 6:43 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
http://www.codeblocks.org/downloads/26
23rd Jul 2020, 10:23 AM
Kry$tof
+ 1
So basically the solution of krystof worked best and it's all I've done which is installing mingw and choosing it's path in cb and it didn't work the first try cause i think i did it wrong but after i watched the video on how to do it correctly it was done correctly. Thanks everyone for helping me
25th Jul 2020, 9:29 AM
Youssef Hossam
Youssef Hossam - avatar
23rd Jul 2020, 9:41 AM
AKSHAY🇮🇳
AKSHAY🇮🇳 - avatar
0
Can you please paste the code here?
23rd Jul 2020, 10:12 AM
Kry$tof
0
#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; }
23rd Jul 2020, 10:15 AM
Youssef Hossam
Youssef Hossam - avatar
0
It's just that I'm totally new and I don't know anything like what's a header, a class or a console, basically nothing and I googled a lot but found nothing, all were about more and more complicated stuff, i really apologize for being so noob lol
23rd Jul 2020, 10:17 AM
Youssef Hossam
Youssef Hossam - avatar
0
Youssef Hossam the code is fine, where are you compiling it?
23rd Jul 2020, 10:17 AM
Kry$tof
0
Code blocks
23rd Jul 2020, 10:18 AM
Youssef Hossam
Youssef Hossam - avatar
0
What operating system are you using?
23rd Jul 2020, 10:19 AM
Kry$tof
0
I checked that swim
23rd Jul 2020, 10:20 AM
Youssef Hossam
Youssef Hossam - avatar
0
Windows 7 ultimate
23rd Jul 2020, 10:20 AM
Youssef Hossam
Youssef Hossam - avatar
0
It's GNU GCC compiler
23rd Jul 2020, 10:20 AM
Youssef Hossam
Youssef Hossam - avatar
0
I think you haven't setup the compiler correctly. Delete code::blocks and on their site, there is download option "cb mingw setup" download this one you will have compiler already setup for you.
23rd Jul 2020, 10:23 AM
Kry$tof
0
Okay I'll do that
23rd Jul 2020, 10:25 AM
Youssef Hossam
Youssef Hossam - avatar
0
Thanks everyone for your time
23rd Jul 2020, 10:28 AM
Youssef Hossam
Youssef Hossam - avatar
0
If it's working, please mark Right answer with ✔️
23rd Jul 2020, 10:30 AM
Kry$tof
0
Ok
23rd Jul 2020, 10:30 AM
Youssef Hossam
Youssef Hossam - avatar
0
Okay so I've downloaded the program from the link you provided then it couldn't open cause it should've been a 32 bit program or something so I downloaded another one which was of 32 bit from the site which had the text (compiler included), after that I installed it then chose the option that installs the gnu gcc compliler and after I installed it and ran it it gave me a message on the left bottom of my screen saying "can't find executable in your configured search path's for gnu gcc compiler" .
23rd Jul 2020, 11:39 AM
Youssef Hossam
Youssef Hossam - avatar