building python shared lib for embedded python project

David Voswinkel d.voswinkel at centrium.de
Wed Dec 4 07:33:15 EST 2002


hello list,


i want to write c plugin for server system.
the plugin is meant to implement python scripting support the system.
while using libpython2.2.a i had problems running scripts thate imported 
modules like time which depends on time.so which had problems
to see symbols form static python lib.
i dont want to change dlopen modus in the server to RTLD_GLOBAL.
now iam trying to make python as shared lib.


i have build my own libpython2.so 
like this,

4     ar x libpython2.2.a
5     ld -shared -export-dynamic -L/usr/lib -lnsl -ldl -lreadline -lieee 
-lpthread -lutil -lutil -lm -lc  -o libpython2.so.0.0 *.o 
6     ln -s   libpython2.so.0.0 libpython2.so.0
7     ln -s   libpython2.so.0.0 libpython2.so

python.o is also in the so.

then i wrote a small embedded python interpreter.
this one is called pyplugin.so 
i linked with  '-L pythonso/  -lpython2  -export-dynamic'

as a load my own plugin pyplugin.so or libpython2.so in a small
test c programm i get dl errors.

can't load plugin: ./libpython2.so: undefined symbol: stat64

maybe someone on the list has an idea to resolve the symbol problem.


greetings david









-- 
{
David Voswinkel
d.voswinkel at centrium.de
} 



More information about the Python-list mailing list