Where to find symbols in libraries?

Aug 10, 2006 4 Replies

I have a basic question about libraries.



I am trying to build konqueror embedded, and if I use only the libraries on my embedded system, the build fails because it cannot find inet_pton.



The problem is described here: .



The solution is to set up your libs so that configure can find the lib with inet_pton....



So... How do I find out which lib I need?



nm returns a whole pile of inet_pton symbols, but I have no idea how to read it.



Could someone help me out?



Thanks,


--Yan


CptDondo wrote in news: snipped-for-privacy@corp.supernews.com:

There *should* be on a properly done library (not very often these days) a man page for every fuction (man 3 (?)). In addition you could try greping the include files - they *have* to have a reference for a compile to work. This would require - as all of what your're trying to do - the development libraries.

(setq (chuck nil) car(chuck) )

On my system, thats libc.

Normally the man page will tell you about the library, since this is libc which comes in automatically, it appears not to be mentioned.

The nm man page explains the output.

inet_pton has a valid manpage. However, said page doesn't have "link with libFOO" in it. OTOH:

amantha:/usr/lib$ nm -A *\.a 2>/dev/null | grep inet_pton | grep -v 'U ' libapr-0.a:inet_pton.o:00000000 T apr_inet_pton libc.a:inet_pton.o:000000c0 T inet_pton [snip]

...so I think the thing is in libc, at least on a non-embedded system. I was able to compile and run a short, stupid test program that called inet_pton() without any -l options at all. So, I think this may be an embedded problem. You may be able to use a modified version of the nm above to get the right library name, since this thing has a less-than standard setup. HTH,

Matt G|There is no Darkness in Eternity/But only Light too dim for us to see Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong http://www.brainbench.com / "He is a rhythmic movement of the -----------------------------/ penguins, is Tux." --MegaHAL

OK so I take it that I need to match up the *exact* name of the symbol? So apr_inet_pton is different from inet_pton?

And that the 'T' symbols are the only ones I am looking for?

(This sort of low-level stuff is pretty new to me; usually my stuff just compiles automagically - at least when I don't screw up the code. For a heightened sense of frustration I recommend cross-compiling big c++ apps like qt and konqueror embedded....) :-)

--Yan

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required