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. Mobile Development
  3. Mobile
  4. Socket Server

Socket Server

Scheduled Pinned Locked Moved Mobile
helpc++sysadminquestion
2 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.
  • D Offline
    D Offline
    Deepa Gopal
    wrote on last edited by
    #1

    Hi All, I used the following code to create a socket in my EVC++ program: #include "winsock.h" if (WSAStartup (MAKEWORD(1,1), &WSAData) != 0){ wsprintf (szError, TEXT("WSAStartup failed. Error: %d"), WSAGetLastError ()); MessageBox (hWnd, szError, TEXT("Error"), MB_OK); } if ((WinSocket = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { wsprintf (szError, TEXT("Allocating socket failed. Error: %d"), WSAGetLastError ()); MessageBox (hWnd, szError, TEXT("Error"), MB_OK); } I have no compile error but a link error that states : error LNK2019: unresolved external symbol _socket@12 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) It would be great if somebody could kindly help me out of this. Thanks and Regards, Deepa Gopal.:confused:

    M 1 Reply Last reply
    0
    • D Deepa Gopal

      Hi All, I used the following code to create a socket in my EVC++ program: #include "winsock.h" if (WSAStartup (MAKEWORD(1,1), &WSAData) != 0){ wsprintf (szError, TEXT("WSAStartup failed. Error: %d"), WSAGetLastError ()); MessageBox (hWnd, szError, TEXT("Error"), MB_OK); } if ((WinSocket = socket (AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { wsprintf (szError, TEXT("Allocating socket failed. Error: %d"), WSAGetLastError ()); MessageBox (hWnd, szError, TEXT("Error"), MB_OK); } I have no compile error but a link error that states : error LNK2019: unresolved external symbol _socket@12 referenced in function "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z) It would be great if somebody could kindly help me out of this. Thanks and Regards, Deepa Gopal.:confused:

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Add winsock.lib to the list of Object/Library Modules in the Link tab in Project Settings. Stability. What an interesting concept. -- Chris Maunder

      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