I hate errors...
Code:$ gcc -o sck sck.o
sck.o:sck.c:(.text+0x45): undefined reference to `WSAStartup@8'
collect2: ld returned 1 exit status
I checked out winsock2.h and WSAStartup() is declared, so I have no idea what's going on. Anyone have any ideas?Code:#include <stdio.h>
#include <windows.h>
#include <winsock2.h>
int main()
{
WSADATA wsaData;
if(WSAStartup(MAKEWORD(2, 0), &wsaData) != 0)
{
printf("Socket failed to init\n");
return 0;
}
printf("Socket init.\n");
return 0;
}
