Thread: Problem with g++ in Ubuntu 10.04

  1. #1
    Registered User
    Join Date
    Mar 2010
    Location
    pkr
    Posts
    32

    Problem with g++ in Ubuntu 10.04

    When I type g++ in my shell it replies no input files
    this makes me think I have g++ installed but
    when i type g++ example.cpp it displays
    isostream no directory or files found
    cin not recognized or something like these statement comes

    gcc works fine in compiling my C files
    I have also install build essential but too its not working
    Please Help me...

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    The header is called "iostream".

  3. #3
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Possibly your g++/gcc install is misconfigured (eg not everything fully installed).

    Try typing "which g++" to see what is being executed. Use g++ -v to work out what version, etc.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Post the code of example.cpp.
    bit∙hub [bit-huhb] n. A source and destination for information.

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    I would guess you also need to install the GNU C++ standard library as well.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  6. #6
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,229
    And I believe it's just a typo in the code...

    Read the post!

  7. #7
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    Quote Originally Posted by cyberfish View Post
    And I believe it's just a typo in the code...

    Read the post!
    I did. You responded to the typo in your first post, and I saw no need to reiterate that.

    Subsequent posts by Salem and I addressed the symptoms described, as it is possible the typo was in the post rather than in the code.

    Inability to find a C++ standard header can be a symptom of compiler misconfiguration or a missing/misconfigured C++ standard library.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  8. #8
    Third Eye Babkockdood's Avatar
    Join Date
    Apr 2010
    Posts
    352
    It's not isostream, it's iostream. Your source should compile after you fix your typo.

  9. #9
    Registered User
    Join Date
    Mar 2010
    Location
    pkr
    Posts
    32

    Thanks to all

    Thanks for the solution I was such a dumb not to know that thing but it was my first time in linux and C++ combine

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    That's okay. I have been known to #include <iosteam>.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Problem With Code In Ubuntu ,please Help Me
    By krisvamc in forum C Programming
    Replies: 2
    Last Post: 04-12-2007, 11:55 PM
  3. Problem With Code In Ubuntu ,please Help Me
    By krisvamc in forum Linux Programming
    Replies: 0
    Last Post: 04-12-2007, 05:08 PM