Find the answer to your Linux question:
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: ...
  1. #1
    Just 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";
    }

  2. #2
    Just 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.

  3. #3
    Just 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

  4. #4
    Just Joined!
    Join Date
    May 2011
    Posts
    0
    Add the following line before int main() line :

    using namespace std;

  5. #5
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •