Date: Fri, 19 Apr 1996 19:36:49 +0100 From: "Gary Palmer" <gpalmer@FreeBSD.ORG> To: Angelo Turetta <ATuretta@stylo.it> Cc: "'freebsd-questions'" <freebsd-questions@FreeBSD.ORG> Subject: Re: How can I use gethostname() in snake_saver ?? Message-ID: <4868.829939009@palmer.demon.co.uk> In-Reply-To: Your message of "Fri, 19 Apr 1996 18:36:07 %2B0200." <c=IT%a=_%p=stylo%l=STYLOSERVER960419183610BF006300@styloserver.stylo.it>
next in thread | previous in thread | raw e-mail | index | archive | help
Angelo Turetta wrote in message ID <c=IT%a=_%p=stylo%l=STYLOSERVER960419183610BF006300@styloserver.stylo.it>: > I'm learning unix programming, so I'm obviously missing some very basic > information: please, be patient :-) > > I've modified snake_saver.c to make it use the host name as its 'snake' > message. The hack is really simple: in saver_load() I use gethostname(3) to > fill a static array that is later used by snake_saver() instead of the local > array 'saves'. > > When I try to install the screen saver using modload(8), I get: > > /usr/src/lkm/syscons/snake> modload -u -o /tmp/saver_mod -e saver_init -q > /lkm/snake_saver_mod.o > /lkm/snake_saver_mod.o: Undefined symbol `_gethostname' referenced from > text segment > modload: /usr/bin/ld: return code 1 > > Is it only some -lxxxx missing or am I pretending too much :-) ???? Err. You do realise that you're linking against the kernel and not shared libraries? I'm not sure how hard it is to do that ... Certainly the kernel version of ``gethostname'' takes different parameters than the libc version. Gary -- Gary Palmer FreeBSD Core Team Member FreeBSD - Turning PC's into workstations. See http://www.FreeBSD.ORG/ for info.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4868.829939009>