I'm Trying to build a simple socket.
#include<stdio.h>
#include<winsock2.h>
#include<ws2tcpip.h>
int getaddrinfo(const char *node,
const char *service,
const struct addrinfo *hints,
struct addrinfo **res);
int main(int argc, char *argv[])
{
WSADATA wsa;
SOCKET a;
printf("Initializing...");
if(WSAStartup(MAKEWORD(2,2),&wsa)!=0);
printf("Failed, Error:%d",WSAGetLastError());
if((a=socket(AF_INET,SOCK_STREAM,0))==INVALID_SOCKET);
printf("Failed, Error:",WSAGetLastError());
return 0;
}
But getting the error "Undefined reference to..." on all winsock2 related functions(like WSAStartup).