Sockets

This is a discussion on Sockets within the Windows Programming forums, part of the Platform Specific Boards category; Ive read loads of tutorials on programming sockets in windows but every example ive tried doesn't compile properly unresolved external ...

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    42

    Sockets

    Ive read loads of tutorials on programming sockets
    in windows but every example ive tried
    doesn't compile properly


    unresolved external symbol _WSAStartup@8


    Code:
    
    #include <winsock.h> 
    
    
    void int()
    {
    
    
    WSADATA info;
    if (WSAStartup(MAKEWORD(1,1), &info) != 0)
      MessageBox(NULL, "Cannot initialize WinSock!", "WSAStartup", MB_OK);
    
    
    }

    My understanding is the code above should
    create a valid winsock connection, but it doesn't


    Im using Visual C++ 6.0 is this the best way to
    use sockets or is there another way


    Marky_Mark
    Last edited by Marky_Mark; 10-23-2001 at 07:05 AM.

  2. #2
    Registered User WayTooHigh's Avatar
    Join Date
    Aug 2001
    Posts
    101
    add wsock32.lib to your project
    Sometimes, the farthest point from the center is the center itself.

    Your life is your canvas, it's only as beautiful as you paint it.

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    42
    Thanks it works now



    Marky_Mark
    Last edited by Marky_Mark; 10-23-2001 at 05:54 PM.

  4. #4
    Caffienated jinx's Avatar
    Join Date
    Oct 2001
    Posts
    235

    Talking Hey...

    Thanks ofr that tip of adding the .lib file. I have a winsock prog that hasn't worked for me, ever. Now the problem is fixed, thanks!!!!!
    Weeel, itss aboot tieme wee goo back too Canada, eeehy boyss.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Best way to poll sockets?
    By 39ster in forum Networking/Device Communication
    Replies: 3
    Last Post: 07-22-2008, 01:43 PM
  2. Cross platform sockets
    By zacs7 in forum Networking/Device Communication
    Replies: 5
    Last Post: 06-27-2007, 05:16 AM
  3. multiple UDP sockets with select()
    By nkhambal in forum Networking/Device Communication
    Replies: 2
    Last Post: 01-17-2006, 06:36 PM
  4. Raw Sockets and SP2...
    By Devil Panther in forum Networking/Device Communication
    Replies: 11
    Last Post: 08-12-2005, 04:52 AM
  5. Starting window sockets
    By _Cl0wn_ in forum Windows Programming
    Replies: 2
    Last Post: 01-20-2003, 10:49 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21