Re: [ctypes-users] how to handle library interdependencies
Brought to you by:
theller
|
From: Andrew M. <And...@ac...> - 2006-10-12 00:43:44
|
> -----Original Message----- > I tried using the following calling syntax to load my=20 > library, which appears to accept the mode argument. However,=20 > I still get the unresolved symbol no matter what I use.=20 > RTLD_LAZY appears to not be accepted as an argument, but even=20 > when I use 1, which is the value RTLD_LAZY is set to in=20 > /usr/include/bits/dlfcn.h, it still fails on the undefined=20 > symbol. Sigh. Any suggestions? A quick peek in the source for ctypes 1.0 shows that RTLD_NOW is being=20 forced, overriding any attempt to use RTLD_LAZY. RTLD_LAZY hasn't been defined as a ctypes constant, probably because=20 it isn't being allowed (not all Posix like Oses may support it maybe?). If you're in a position to recompile/reinstall ctypes: - comment out the "mode |=3D RTLD_NOW;" at about line 1207 in=20 source/callproc.c - at about line 4705 in source/_ctypes.c add "PyModule_AddObject()" calls=20 to add definitions for RTLD_LAZY and (for completeness) RTLD_NOW. Rebuild/reinstall and then call LoadLibrary() with the option set to=20 ctypes.RTLD_GLOBAL | ctypes.RTLD_LAZY BTW, I presume this is on Linux? Or Solaris? The "PrmLic" seems=20 familiar - would the libraries you're having trouble with be part of an=20 ESRI product? If so, you might be able to find some samples which list=20 the order of the libraries on a linkage command line, which would be a=20 strong hint as to the order you should load the SOs. Regards, Andrew. -------------------------> "These thoughts are mine alone!" <--------- Andrew MacIntyre National Licensing and Allocations Branch tel: +61 2 6219 5356 Inputs to Industry Division fax: +61 2 6253 3277 Australian Communications & Media Authority email: and...@ac...=20 |