I cerated a simple server.c program in class. it worked fine.

When compiling i had to do gcc server.c -o server -lsocket. It worked fine on the Sun Microsystems in the class.

When i got home i tried to compile the same program on Ubuntu. When compiling i get the following error:

gcc server.c -o server
server.c: In function ‘main’:
server.c:11: error: storage size of ‘servaddr’ isn’t known
server.c:11: error: storage size of ‘cliaddr’ isn’t known
server.c:15: warning: incompatible implicit declaration of built-in function ‘bzero’
server.c:17: error: ‘INADDR_ANY’ undeclared (first use in this function)
server.c:17: error: (Each undeclared identifier is reported only once
server.c:17: error: for each function it appears in.)

Any help would be appreciated (I also tried to do gcc server.c -o server -lsocket, with the same errors.