If libfoo.so might be used by/useful to a program written in some other
language, it would be kind of the library developer to link libfoo.so
with -lc. This just adds the soname libc.so.6 so ld and ld.so know how
to resolve lobfoo.so's references. I think in general it is a good idea
for a shared library to be linked with any other shared library it
depends on.
There are other ways to work it, but this seems to me to be the most
straighforward.
Lawson
>< Microsoft free environment
This mail client runs on Wine. Your mileage may vary.
On Fri, 9 Apr 1999, Slava Chernobai wrote:
> Hi.
>
> I have such problem:
>
> $ gcc -fPIC -o foo.o foo.c
> $ gcc -shared -o libfoo.so libfoo.o
> $ ldd -r libfoo.so
> statically linked
> undefined symbol: printf ()
> ...
> Program, that uses libfoo's functions linked against libc.so.6.
> It works well.
>
> libfoo uses printf (and other functions) from libc, but gcc doesn't
> link shared libraries against libc.so.6 by default.
>
> Question. Does shared library needs to be linked against the libraries,
> functions from it uses?
>
> --
> Slava
> mailto:[EMAIL PROTECTED]
>
>
>
___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]