Monday, May 24, 2010

Compilation errors from borland turbo c++ that I can't figure out, trying to use sockets?

I am trying to use sockets in borland turbo c++, but I am getting 2 compile errors and I do not understand what to do. Below is my program and the errors. Plz help. Thank You.





#include %26lt;stdio.h%26gt;


#include %26lt;winsock2.h%26gt;


int main(int argc, char *argv[])


{ socket starts, s; sockaddr_in sockin;


starts=socket(AF_INET,SOCK_STREAM,IPPROT...


sockin.sin_family=AF_INET;


sockin.sin_addr.s_addr = INADDR_ANY;


sockin.sin_port=htons(40254);


if(!bind(starts,(sockaddr *)%26amp;sockin,sizeof(struct sockaddr_in)))


printf("bind error");


scanf("");


return 0;


}





line 4 E2379 Statement missing


line 5 E2541 Undefined symbol 'starts'

Compilation errors from borland turbo c++ that I can't figure out, trying to use sockets?
socket is not a type. socket returns a file descriptor. change socket starts, s; to int starts, s;

our song

No comments:

Post a Comment