[C++-sig] Dynamic Cast failed over multiple modules
Holger Brandsmeier
brandsmeier at gmx.de
Thu Sep 8 14:14:38 CEST 2011
Mathieu,
thank you very much. This is exactly what I was still missing.
-Holger
On Thu, Sep 8, 2011 at 12:00, Mathieu Malaterre
<mathieu.malaterre at gmail.com> wrote:
> On Thu, Sep 8, 2011 at 11:56 AM, Holger Brandsmeier <brandsmeier at gmx.de> wrote:
> [...]
>> CMAKE_SHARED_LINKER_FLAGS. About the RTLD_GLOBAL flag for dlopen, I
>> don't know how python handles this.
>>
>> Do you have any ideas how to solve this? Or is this simply not
>> possible with python?
>
> Here is what I use:
>
> if os.name == 'posix':
> orig_dlopen_flags = sys.getdlopenflags()
> try:
> import dl
> except ImportError:
> try:
> import DLFCN as dl
> except ImportError:
> dl = None
> if dl:
> sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)
> # now load the module !
> from gdcmswig import *
> sys.setdlopenflags(orig_dlopen_flags)
> del dl
> del orig_dlopen_flags
>
>
> ref:
> http://gdcm.git.sourceforge.net/git/gitweb.cgi?p=gdcm/gdcm;a=blob;f=Wrapping/Python/gdcm.py;h=fd7ee0da80297d608c2939b8661ce0e81c33314a;hb=HEAD
>
> --
> Mathieu
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
More information about the Cplusplus-sig
mailing list