I am using dev c++ and getting a linker error. I understand what it means somewhat, but I do not know how to fix it. Here is my program:
#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.
2007-03-13
12:50:03
·
3 answers
·
asked by
Anonymous