cross-project inheritance question
"Langer, Stephen A. \(Fed\) via Swig-user" <[email protected]> Thu, 13 Oct 2022 19:41:35 +0000
| Newsgroups | gmane.comp.programming.swig |
|---|---|
| Message-ID | <[email protected]> |
Hi -- I have two projects, A and B. Both are a mix of C++ and Python, with swig4 interfaces. Project A defines some classes that are used in project B, both by importing python modules and by C++ #includes. A C++ class in B (BClass) is derived from a C++ class in A (AClass). Both classes have swig-generated Python equivalents. In Python, I want to pass a wrapped instance of the derived class (in B) to a wrapped function in A that expects an AClass* argument. But the wrapper for A is rejecting the argument because it doesn't know that BClass is derived from A's AClass. How can I tell swig about the inheritance? I've tried declaring AClass as "extern" in B's swig file, and also duplicating AClass in the file, but those don't seem to work. Should I add a typemap to A so that the function doesn't check its argument type, and just call SWIG_ConvertPtr manually? Thanks, Steve _______________________________________________ Swig-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/swig-user