From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert Nail" To: "Alexandre Oliva" Cc: Subject: Re: Where are the socket libraries? Date: Fri, 08 Dec 2000 06:56:00 -0000 Message-id: <002d01c06125$e30c6b20$02c44720@ENTACTNAIL> References: <20001207140759.3268.qmail@mailweb20.rediffmail.com> <003d01c06060$b99a54c0$02c44720@ENTACTNAIL> X-SW-Source: 2000-12/msg00040.html The source I have is below: The error messages I get when trying to gcc this stuff is: request for member "sin_family" in something not a structure or union request for member "sin_addr" in something not a structure or union request for member "sin_port" in something not a structure or union The only place I can find sin_family and such is on /usr/include/linux/in.h. I have tried to include but it makes no difference. All help will be appreciated. Thanks #include #include #include main() { int i,j; int sock1; char ibuf[BUFSIZ]; struct sockaddr *serv; memset(&serv,0,sizeof(serv)); serv.sin_family = AF_INET; serv.sin_addr.s_addr = inet_addr("333.444.555.6"); serv.sin_port = htons(777); if(connect(sock1, (struct sockaddr*) &serv,sizeof(serv)) < 0) printf("Error on connect\n"); i = write(sock1,"This is test1",13); i = read(sock1,ibuf,20); printf("Ibuf: %s\n",ibuf); } ----- Original Message ----- From: "Alexandre Oliva" To: "Robert Nail" Cc: Sent: Thursday, December 07, 2000 10:36 AM Subject: Re: Where are the socket libraries? > On Dec 7, 2000, "Robert Nail" wrote: > > > I try to link a simple socket program for Linux 6.0 but it can't find the > > SOCKADDR structure. > > This will list the header files you may have to include to get its > definition: > > grep -l -r SOCKADDR /usr/include > > Then, you may have to link your program with some libraries (!= header > files) to get definitions of whatever functions you use. > > -- > Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/ > Red Hat GCC Developer aoliva@{cygnus.com, redhat.com} > CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org} > Free Software Evangelist *Please* write to mailing lists, not to me