I am writing a c++ code (or any sort of code for that matter) after one complete year. And yet I don't think I could have become so bad that I can't make a Hello World program. Still, here I am with so many errors.
Jun 03, 2012 iostream is a C header, so you need to use g to compile it. Using is depreciated. Use iostream instead and either explicitly precede the commands with the namespace or use the line 'using namespace std;'. May 21, 2017 iostream.h is not a standard header file (if anything supports it, it's for backward compatibility from long ago). Use iostream instead. None of the header files introduced in C have an extension. The same advice goes for over as well.
Here's the code:-
Here are the errors I am getting :-
C:Documents and Settingsjay mata diMy Documentsc++hello.c|1|error: iostream.h: No such file or directory|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'|
C:Documents and Settingsjay mata diMy Documentsc++hello.c||In function 'main':|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: 'cout' undeclared (first use in this function)|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: (Each undeclared identifier is reported only once|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: for each function it appears in.)|
|| Build finished: 5 errors, 0 warnings |
C:Documents and Settingsjay mata diMy Documentsc++hello.c|3|error: expected '=', ',', ';', 'asm' or '__attribute__' before 'namespace'|
C:Documents and Settingsjay mata diMy Documentsc++hello.c||In function 'main':|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: 'cout' undeclared (first use in this function)|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: (Each undeclared identifier is reported only once|
C:Documents and Settingsjay mata diMy Documentsc++hello.c|7|error: for each function it appears in.)|
|| Build finished: 5 errors, 0 warnings |
I guess the problem's with the compiler or my computer (I am using codeblocks.) I ran the program online. It ran just fine. How can I rectify it?
Errno 2 No Such File Or Directory
- 4 Contributors
- forum 8 Replies
- 1,973 Views
- 1 Year Discussion Span
- commentLatest Postby pc75Latest Post
![Compilation Compilation](/uploads/1/2/6/1/126176085/705882862.png)
![Iostream No Such File Or Directory Dev C++ Iostream No Such File Or Directory Dev C++](/uploads/1/2/6/1/126176085/748210401.png)