Results 1 to 5 of 5
I am new to linux and need all possible help dat is available.
While compiling my c++ programs as
c++ hello.cpp or gcc hello.cpp
I get the foll. error
hello.cpp:1:21: ...
- 05-14-2011 #1Just Joined!
- Join Date
- May 2011
- Posts
- 0
Hi
I am new to linux and need all possible help dat is available.
While compiling my c++ programs as
c++ hello.cpp or gcc hello.cpp
I get the foll. error
hello.cpp:1:21: fatal error: iostream.h: No such file or directory
pls help
the code written is
#include<iostream.h>
int main()
{
cout<<"Hello\n";
}
- 05-14-2011 #2Just Joined!
- Join Date
- May 2011
- Posts
- 0
Instead of <iostream.h> write <iostream>, i.e., remove ".h" of "iostream.h". This should solve the error.
- 05-15-2011 #3Just Joined!
- Join Date
- May 2011
- Posts
- 0
Thx 4 d suggestion but now
A new error cropped in
hello.cpp: In function ‘int main()’:
hello.cpp:5:2: error: ‘cout’ was not declared in this scope
v
- 05-15-2011 #4Just Joined!
- Join Date
- May 2011
- Posts
- 0
Add the following line before int main() line :
using namespace std;
- 05-16-2011 #5Just Joined!
- Join Date
- May 2011
- Posts
- 0
Hooray!
It worked
Can u throw me sum lyt on y we use "using namespace std;" ??
Thx a ton


Reply With Quote
