ld and libsmbclient

Peter Waechtler peter at helios.de
Tue Mar 9 08:07:11 GMT 2004

Am Montag, 8. März 2004 18:09 schrieb Steven McClellan:
> Hello,
> I originally posted this email to the samba at lists.samba.org but was told
> that I should probably post it here because I did not receive a response.
Didn't they tell you to post an error message? ;)

> I am having some difficulty making ld resolve the functions in the
> libsmbclient.so when linking.  I am using samba 3.0.2a on a fully patched
> red hat 9 system and the shared library is being built ok.  There must be
> something wrong with the shared library installation.  Could somebody
> please walk me through all of the steps necessary for getting the library
> installed correctly.  The make install only copied the libsmbclient.so.
> I have added the path to libsmbclient.so in the ld.so.conf file and run
> ldconfig.  I have also verified that the libsmbclient.so is in the
> ld.so.cache by doing a ldconfig -p.  Everything looks good but ld cannot
> resolve the smbc_init function (or any other function from the library). 
> If I remove the the library path for libsmbclient and then run ldconfig
> again, ld will produce another error message saying that it can't find the
> library instead of saying that it can't resolve the function.
$ nm /usr/lib/libsmbclient3.so| grep smbc_init
00020980 T smbc_init
00020400 T smbc_init_context
000b2580 b smbc_initialized

the capital "T" denotes an exported text (code) symbol. If it's a "t" then
it's not exported (defined as static in the code perhaps).

> I suspect that there is a dependent library or some other similar problem
> but I can't figure it out.  I would run ldd on the executable to check for
> missing libraries but since I can't link and get an executable file, I'm
> stuck.  I have tried several different versions of samba, all with the same
> result so I must be missing something.
So you try to link your program against libsmbclient.so?

gcc sample.c -L /where/is/smbclient.so -lsmbclient

More information about the samba-technical mailing list