Importing binary modules

Thinker thinker at branda.to
Thu Mar 1 06:21:13 EST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

andre.dos.anjos at gmail.com wrote:
cut ......................
>
> The problem appears when libMyNewModule.so depends on another
> library, say libfoo.so, which sits also in /my/module/dir. In that
> case, '/my/ module/dir', needs to be preset in the LD_LIBRARY_PATH
> *before* the python interpreter is set.
>
> In this case, the snippet of code above will not work as one would
> expect. It will normally give an ImportError saying it cannot find
> libfoo.so. That happens, apparently, because the dynamic linker
> cannot rescan LD_LIBRARY_PATH after the python interpreter has
> started.
Since you create a new module, you should try to link your module with
- -rpath-link option.
You can specify a path searched by linker when finding shared object
required.



- --
Thinker Li - thinker at branda.to thinker.li at gmail.com
http://heaven.branda.to/~thinker/GinGin_CGI.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF5rcp1LDUVnWfY8gRAmLcAKCobvo06x84L0pj66amTBspTJ9nUwCg5sA+
MP7tLF/i8zqoZHl5Fxw2YsQ=
=BNQy
-----END PGP SIGNATURE-----




More information about the Python-list mailing list