[C++-sig] RTLD_GLOBAL cures my g++ + Boost.Python + cross module blues?

Itamar Shtull-Trauring itamar at itamarst.org
Mon Apr 25 17:54:58 CEST 2005


On Wed, 2005-04-20 at 17:50 -0700, J. Michael Owen wrote:

> import sys, dl
> sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> 
> While this seems to have solved all of my current cross-library problems, I'm 
> suspicious that it could be this simple.  Does anyone else here have any 
> experience with these g++/Boost.Python/cross module issues?  Is there a 
> reason the above might be a bad idea?

This is what I do. The only possible problem, I think, is that the
symbols might conflict with other C modules you will load later. Using
namespaces should make this unlikely, and I typically reset dlopenflags
back to normal (i.e. no RTLD_GLOBAL) once I've imported my boost module.

And of course this won't work on Windows :)





More information about the Cplusplus-sig mailing list