ctype question

Thomas Heller theller at python.net
Fri Jun 5 01:54:10 EDT 2009


Amit Gupta schrieb:
> Hi,
> 
> I have been using ctype.cdll to load a library, but I am unable to
> figure out how to load multiple libraries that depends on each other.
> E.g. I have two libraries A.so and B.so. A.so has some undefined
> references, and those symbols are defined in B.so.
> 
> When I try to load ctypes.cdll.LoadLibrary("A.so"), it gives errors
> about the undefined Symbols. Even if I load B.so before loading A.so,
> the error remains the same (which is expected). Can someone help me to
> find out, how to load A.so by telling it to look for undefined symbols
> in B.so as well?

You could try to pass ctypes.RTLD_GLOBAL as the 'mode' parameter to
ctypes.CDLL when you load the library.

Thomas



More information about the Python-list mailing list