2007-03-13 16:50:03 UTC
#include
#include
int main(int argc, char *argv[])
{ int starts, s; sockaddr_in sockin; WSAData *wsa;
if(WSAStartup(MAKEWORD(1,1),wsa))
return 1;
starts=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
sockin.sin_family=AF_INET;
sockin.sin_addr.s_addr = INADDR_ANY;
sockin.sin_port=htons(40254);
if(!bind(starts,(sockaddr *)&sockin,sizeof(struct sockaddr_in)))
return 2;
scanf("");
WSACleanup();
return 0;
}
i get undefined reference to: 'WSAStartup@8', socket@12, htons@4, bind@12, WSACleanup@0
I do not really understand how to link a .dll. Thanks for your help.