Fatal error: iostream: no such file or directory | Sololearn: Learn to code for FREE!

+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?

7/23/2020 9:38:41 AM

Youssef Hossam

27 Answers

New Answer

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

+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

+2

Check if you have created a C project in Codeblocks instead of C++ project.

+2

Windows is not a problem. Did you installed just CodeBlocks IDE or CodeBlocks IDE with compiler? You need IDE with Compiler. Or there could be an issue with your compiler installation.

+1

http://www.codeblocks.org/downloads/26

+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

0

https://www.sololearn.com/learn/CPlusPlus/1603/

0

Can you please paste the code here?

0

#include <iostream> using namespace std; int main() { cout << "Hello world!"; return 0; }

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

0

Youssef Hossam the code is fine, where are you compiling it?

0

Code blocks

0

What operating system are you using?

0

I checked that swim

0

Windows 7 ultimate

0

It's GNU GCC compiler

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.

0

Okay I'll do that

0

Thanks everyone for your time

0

If it's working, please mark Right answer with ✔️