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. General Programming
  3. C / C++ / MFC
  4. gethostbyname C2143

gethostbyname C2143

Scheduled Pinned Locked Moved C / C++ / MFC
c++comhelpquestion
3 Posts 2 Posters 0 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.
  • V Offline
    V Offline
    Vadim Tabakman
    wrote on last edited by
    #1

    Hi all, Simple function (cut down to not include all the other crap. I have #included the winsock.h and included the wsock32.lib. int GetIPAddresses() { char shostname[255]; int e = 0; e=gethostname(shostname, sizeof(shostname)); struct hostent *pdata = ::gethostbyname(ashostname); } On compiling I get this error : error C2143: syntax error : missing ';' before 'type' Does anyone know what that is? [EDIT]This is in C and not C++. I forgot to mention that.[/EDIT] Cheers, "If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)

    A 1 Reply Last reply
    0
    • V Vadim Tabakman

      Hi all, Simple function (cut down to not include all the other crap. I have #included the winsock.h and included the wsock32.lib. int GetIPAddresses() { char shostname[255]; int e = 0; e=gethostname(shostname, sizeof(shostname)); struct hostent *pdata = ::gethostbyname(ashostname); } On compiling I get this error : error C2143: syntax error : missing ';' before 'type' Does anyone know what that is? [EDIT]This is in C and not C++. I forgot to mention that.[/EDIT] Cheers, "If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)

      A Offline
      A Offline
      Antony M Kancidrowski
      wrote on last edited by
      #2

      Have you tried using the winsock2 stuff instead? winsock2.h and ws2.lib Ant. I'm hard, yet soft.
      I'm coloured, yet clear.
      I'm fruity and sweet.
      I'm jelly, what am I? Muse on it further, I shall return!
      - David Walliams (Little Britain)

      V 1 Reply Last reply
      0
      • A Antony M Kancidrowski

        Have you tried using the winsock2 stuff instead? winsock2.h and ws2.lib Ant. I'm hard, yet soft.
        I'm coloured, yet clear.
        I'm fruity and sweet.
        I'm jelly, what am I? Muse on it further, I shall return!
        - David Walliams (Little Britain)

        V Offline
        V Offline
        Vadim Tabakman
        wrote on last edited by
        #3

        Hi Ant, Yes I have, and still the same error. Cheers, "If you're too careful, your whole life can become a f---in' grind." - Mike McD (Rounders)

        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