Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. IT & Infrastructure
  4. ostream::operator <<(int) has already been declared in `ostream.h`

ostream::operator <<(int) has already been declared in `ostream.h`

Scheduled Pinned Locked Moved IT & Infrastructure
helptutorialquestion
2 Posts 2 Posters 7 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Kelly
    wrote on last edited by
    #1

    Hi, When I include I get thrown the error below. I'm not so sure why. It was my first inclusion of the header file. In the file, -Error : ostream::operator <<(int) has already been declared in `ostream.h` the code snip its referring to is the following #if _G_HAVE_BOOL ostream& operator<<(bool b) { return operator<<((int)b); #endif It dosen't seem to know how to handle the 'bool'. Thinking the parameter is an int value. Even when I #undef _G_HAVE_BOOL to bypass the ostream declaration , it throws the same error. Anybody got any ideas?? cheers Paul

    L 1 Reply Last reply
    0
    • P Paul Kelly

      Hi, When I include I get thrown the error below. I'm not so sure why. It was my first inclusion of the header file. In the file, -Error : ostream::operator <<(int) has already been declared in `ostream.h` the code snip its referring to is the following #if _G_HAVE_BOOL ostream& operator<<(bool b) { return operator<<((int)b); #endif It dosen't seem to know how to handle the 'bool'. Thinking the parameter is an int value. Even when I #undef _G_HAVE_BOOL to bypass the ostream declaration , it throws the same error. Anybody got any ideas?? cheers Paul

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Do not use old stream library iostream.h. Use #include instead (without .h at the end). Than add using namespace std; line. In most cases, this is all you have to do.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups