Menu

About WinSocket

2002-11-21
2012-09-26
  • Nobody/Anonymous

    Hi :
      I met a problem about Winsocket.
    int main()
      {
       WSADATA  wsaData;
       int              err;
       err = WSAStartup( 0x0202, &wsaData );
       if ( err != 0 ) return -1;
       WSASetLastError(0);
      }
      But when I complied this simple code,I got two error message.
       
    [Linker error] undefined reference to `WSAStartup@8'
    [Linker error] undefined reference to `WSACleanup@0'

    Could someone ttell me what I need to care or add?
       Thanks.
            Jerry.
     

     
    • Nobody/Anonymous

      You gotta link the library at compile time.

      Option is to link the library :    -l"ws2_32"

      BlakJak :]

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.