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. i don't get it anymore

i don't get it anymore

Scheduled Pinned Locked Moved C / C++ / MFC
sysadminhelp
2 Posts 1 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.
  • W Offline
    W Offline
    willempipi
    wrote on last edited by
    #1

    i get: SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__closesocket@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__send@16 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__accept@12 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__bind@12 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__htons@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8 wenn i start my programm, here is my programm: #include winsock2.h bool ServerStart; ...... ...... UINT ServerThread(LPVOID Param) { SOCKET server; WSADATA wsaData; sockaddr_in local; ServerStart = TRUE; int wsaret = WSAStartup(0x101, &wsaData); if (wsaret != 0) { return 0; } local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; local.sin_port = htons((u_short)20248); if (bind(server, (sockaddr*)&local, sizeof(local)) != 0) { return 0; } SOCKET client; sockaddr_in from; int fromlen = sizeof(from); while(ServerStart == TRUE) { char temp[512]; client = accept(server, (struct sockaddr*)&from, &fromlen); sprintf(temp, "Your IP is %s\r\n", inet_ntoa(from.sin_addr)); send (client, temp, strlen(temp), 0); closesocket(client); } closesocket(server); WSACleanup(); return 0; }

    W 1 Reply Last reply
    0
    • W willempipi

      i get: SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSACleanup@0 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__closesocket@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__send@16 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__inet_ntoa@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__accept@12 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__bind@12 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__htons@4 SimpleServer.obj : error LNK2001: unresolved external symbol __imp__WSAStartup@8 wenn i start my programm, here is my programm: #include winsock2.h bool ServerStart; ...... ...... UINT ServerThread(LPVOID Param) { SOCKET server; WSADATA wsaData; sockaddr_in local; ServerStart = TRUE; int wsaret = WSAStartup(0x101, &wsaData); if (wsaret != 0) { return 0; } local.sin_family = AF_INET; local.sin_addr.s_addr = INADDR_ANY; local.sin_port = htons((u_short)20248); if (bind(server, (sockaddr*)&local, sizeof(local)) != 0) { return 0; } SOCKET client; sockaddr_in from; int fromlen = sizeof(from); while(ServerStart == TRUE) { char temp[512]; client = accept(server, (struct sockaddr*)&from, &fromlen); sprintf(temp, "Your IP is %s\r\n", inet_ntoa(from.sin_addr)); send (client, temp, strlen(temp), 0); closesocket(client); } closesocket(server); WSACleanup(); return 0; }

      W Offline
      W Offline
      willempipi
      wrote on last edited by
      #2

      i already found the solution, i had to link my compiler with the file: ws2_32.lib didn't pay attention...:wtf: thnx anyways

      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