Netboot Mailing List (by thread)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cross-compile problem (continued)



Gero Kuhlmann wrote:

> Hello,
>
> Ross Golder <rossg@cpd.co.uk> wrote:
> > And the output of the 'make' :-
> > [... looks good so far ...]
> > mknbi.o: In function 'main':
> > mknbi.o(.text+0xe13): undefined reference to '__inet_ntoa'
> > make[1]: *** [mknbi] Error 1
> > make: *** [all] Error 1
> >
> > I've had this error somewhere before, and resolved it, but I can't
> think
> > how. Excuse my novice status, but am I correct in assuming that the
> > linker is attempting to link in '__inet_ntoa' from an external
> library,
> > but not finding it. What library does this function usually reside
> in?
>
> You are right that __inet_ntoa should be somewhere in the libraries.
> Exact-
> ly what library depends on the system you are working with. On my
> system
> (with glibc-2.0) it's in the standard libc, but on SCO ODT for example
>
> it's in libsocket. In order to find it you can use the 'nm' command.
> Just
> run 'nm libc.a' or any other library, and it prints you all the
> symbols defined
> in the library. Good candidates for libraries having 'inet_ntoa' are:
>
>   libc.a
>   libnsl.a
>   libsocket.a
>   libnet.a
>
> nd just one hint when running 'nm': it will print 'U' for all
> undefined
> symbols (which have to be resolved lateron when running the linker),
> and
> 'T' for symbols defined in the library. Therefore you will want to
> look
> for a 'inet_ntoa' symbol with a 'T' in front.
>

$ nm /lib/libc.so | grep inet_ntoa
00030544 T inet_ntoa

So where is it getting __inet_ntoa from (with two leading underscores)?
Also, how can I check whether 'libc.so' is being linked in?

TIA,

--
Ross Golder
Technical Dept
CPD Ltd, Whetstone, London, N20 9LD.
Tel: +44 (0) 973 897671
mailto:rossg@cpd.co.uk (Work)
http://www.cpd.co.uk/~rossg




For requests or suggestions regarding this mailing list archive please write to netboot@gkminix.han.de.