using gethostbyname()

Jesse Rendleman jesse at camelot.sgi.com
Sat Jun 2 05:59:45 AEST 1990


In article <14410 at thorin.cs.unc.edu> taylorr at glycine.cs.unc.edu (Russell Taylor) writes:
>
>	I am trying to use the 'gethostbyname()' system call in a program.
>The manual entry mentions that I must link with 'libbsd.a' in order to use
>this function.  However, the function is not defined in that library (or
>any other library that I can find) and the loader complains about it being
>undefined.
>
>	Russell Taylor

on my system, "nm /usr/lib/libbsd.a | grep gethostbyname" finds all the
entries you'd expect.

your compile line should be something like "cc prog.c -lbsd -o prog"?

do you have the development option loaded on your machine?  (check
"versions | grep dev", which should say something like...

   I dev                    5900637   Dev Sys PD 3, S5-DV01-3.2, 808-0059-006
   I dev.sw      89/09/06   5800637   Dev Sys SW 3, S5-DV01-3.2, 808-0058-006
   I dev.man     89/09/06   6000637   Dev Sys Man 3, S5-DV01-3.2, 808-0060-006

good luck,



More information about the Comp.sys.sgi mailing list