[Pythonmac-SIG] dynload_next

Marcel Prastawa prastawa@cs.unc.edu
Sun, 27 Jan 2002 12:03:54 -0500


Steven Majewski wrote:

> Without the PRIVATE flag, I still get duplicate symbol errors on
> trying to import  both time and package.time  bundles.


Ah.. I built PyOpenGL as a two-level extension, I've never actually 
tested this case.

Using libdl seems more and more like a good idea to me. It has solved 
the issues we are dealing with. The 'sys' module also provides a Python 
interface to modify the dlopen flags, the setdlopenflags() function (so 
if needed, we can specify GLOBAL instead of PRIVATE dynamically).

If we were to stick with dynload_next, I guess we could write a Python 
interface that would enable/disable the PRIVATE flag (and other flags 
too). Something like sys.setNSLoadFlags() or maybe sys.setdyldflags()?


> The version included in the last post fixes the error reporting -- it
> has an external message buffer.


Oops, sorry I missed it.

BTW, shouldn't we use snprintf(errMessage, sizeof(errMessage), ...) 
instead of plain sprintf()? Is 400 characters enough? Maybe we need more 
for debugging, 2048? 8192? :) The message could get really long when we 
have tons of undefined symbols.

Marcel