[Nagiosplug-help] Re: check_icmp error under Solaris again
Dan Stromberg
strombrg at dcs.nac.uci.edu
Mon Dec 20 15:14:01 CET 2004
On Mon, 2004-12-20 at 22:24 +0100, Andreas Ericsson wrote:
> Horváth Tamás wrote:
> > Hi!
> >
> > Thanks Andreas!
> >
> > I tried what you suggested, but got the following error:
> >
> > bash-2.03# gcc -O2 check_icmp.c -o check_icmp
> > Undefined first referenced
> > symbol in file
> > inet_addr /var/tmp//cc2lIMsO.o
> > getprotobyname /var/tmp//cc2lIMsO.o
> > gethostbyname /var/tmp//cc2lIMsO.o
> > sendto /var/tmp//cc2lIMsO.o
> > h_errno /var/tmp//cc2lIMsO.o
> > socket /var/tmp//cc2lIMsO.o
> > recvfrom /var/tmp//cc2lIMsO.o
> > inet_ntoa /var/tmp//cc2lIMsO.o
> > gethostbyaddr /var/tmp//cc2lIMsO.o
> > ld: fatal: Symbol referencing errors. No output written to check_icmp
> > collect2: ld returned 1 exit status
> >
> >
> > My GCC version is:
> > bash-2.03# gcc -v
> > Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.8/3.3/specs
> > Configured with: ../configure --disable-nls --with-as=/usr/ccs/bin/as
> > --with-ld=/usr/ccs/bin/ld
> > Thread model: posix
> > gcc version 3.3
> > bash-2.03#
> >
> >
> > Sorry, but I'm not a programmer and have absolutely no experience with
> > compiling. How can I solve this issue?
> >
>
> It seems you need to link check_icmp with additional libraries to reach
> the functions you need.
>
> Do like this;
> for i in `grep -l sendto /lib/*.so /usr/lib/*.so | sed -e 's,^.*/lib,,'
> -e 's/\..*//'`; do gcc check_icmp -o check_icmp -l$i; done
>
> That will try linking with all libraries that have a symbol called
> sendto in them (or one referring to it, compiled with debugging
> support). If that doesn't help I'll need more info about the system.
>
> Most likely someone else on this list is more experienced with solaris
> than I am, so they might be able to help you.
This is a good general method.
In the specific, you probably need -lnsl -lsocket
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://www.monitoring-plugins.org/archive/help/attachments/20041220/e213d284/attachment.sig>
More information about the Help
mailing list