[Python-Dev] Extensions that depend on .so's on Solaris

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu, 1 Mar 2001 23:39:01 +0100


> I have a library "libenf.a", which depends on several .so's (Eric
> Young's libeay and a couple of others).

> My C module was pretty simple to put together.  However, when I load
> it, Python (or someone) complains that the symbols that I know are
> in "libeay.so" are missing.

If it says that the symbols are missing, it is *not* a problem of
LD_LIBRARY_PATH, LD_RUN_PATH (I can't find documentation or mentioning
of that variable anywhere...), or the -R option.

Instead, the most likely cause is that you forgot to link the .so when
linking the extension module. I.e. you should do

gcc -o foomodule.so foomodule.o -lenf -leay

If you omit the -leay, you get a shared object which will report
missing symbols when being loaded, except when the shared library was
loaded already for some other reason.

If you *did* specify -leay, it still might be that the symbols are not
available in the shared library. You said that nm displayed them, but
will nm still display them after you applied strip(1) to the library?
To see the symbols found by ld.so.1, you need to use the -D option of
nm(1).

Regards,
Martin