Trouble compiling code

Discussion in 'OT Technology' started by hurleyint1386, Mar 12, 2007.

  1. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    I'm testing out some programs in my book, and I'm writing them exactly as stated, but getting an error. Here's the code:

    and using the G++ compiler, I'm getting the following error:

    Any ideas? It's verbatim from the book.
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    you have not defined your namespace... so you would have to set the scope.

    Code:
    using namespace std
    or refer to ostream as a child member of std:

    Code:
    std::ostream
     
  3. hurleyint1386

    hurleyint1386 Someone has sand in their vagina

    Joined:
    Jan 6, 2005
    Messages:
    3,687
    Likes Received:
    0
    Location:
    Rochester, NY
    i thought it would be a namespace issue. but i figured the book would be right, and i was just mispelling something. thanks, i'll try it out!


    edit: it works! thanks a lot
     
  4. GOGZILLA

    GOGZILLA Double-Uranium Member

    Joined:
    Jan 16, 2003
    Messages:
    10,760
    Likes Received:
    3
    Location:
    Plantation, FL
    how olds the book? namespace is relatively newer
     

Share This Page