View topic - newbee pl help netdb.h

newbee pl help netdb.h

anything that doesn't fit to other groups.

newbee pl help netdb.h

Postby anand » Sat Jul 26, 2003 7:00 am

can anyone pl help me.

i am trying to use geetservbyname function,
which is in the netdb.h
the netdb.h has been included in the c code.

but during compiling, the compiler complains:

undefined reference to 'getservbyname'

this happens for other functions which are in netdb.h

can someone pl help me
anand
New Member
 
Posts: 3
Joined: Fri Jun 27, 2003 9:23 am

Postby cdm » Sun Jul 27, 2003 5:06 am

gcc -o foo foo.o -lsocket

The -lsocket is key - it brings in the socket library.
cdm
QNX Master
 
Posts: 789
Joined: Fri Jul 05, 2002 9:38 am


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron