I get this error when i compile the code to start a winsocket program
'In fucntion 'WinSocketStart':
'Linker Error, unidentified reference to WSAStartup@8'
id returned 1 exit status
i think it means i don't have a library linked. but for winsock 2.0 i don't know how to link it with Dev-C++ any help would be great.
Code:
#include <stdio.h>
#include <conio.h>
#include <winsock2.h>
void WinSockStart(void);
int main(void)
{
WinSockStart();
getchar();
return 0;
}
void WinSockStart(void)
{
//all this is required for any socket programming app
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2,0), &wsaData) !=0) {
fprintf(stderr, "WSAStartup Failed.\n");
exit(1);
}
}