are two key things that were necessary:
1. We have to turn off the -fvisibility=hidden flag, since this hides the symbols in our
shared libraries from others. There's probably a better way to handle this, but this
is expedient for now.
2. Since I'm testing with GNU compilers & linkers, I have to use the magic lines in python
before importing the inter-dependent modules (see test_cross_module_inheritance.py):
import sys, ctypes
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
This shouldn't be necessary on all platforms.
10 lines
286 B
Python
10 lines
286 B
Python
# This bit of magic is required for GNU compilers for now for resolving symbols
|
|
# across libraries. See many rants online regarding this issue...
|
|
import sys, ctypes
|
|
sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
|
|
|
|
import A, B
|
|
|
|
b = B.Derived()
|
|
print isinstance(b, A.Base)
|