Swig c++ w/ Java loses type on polymorphic callback functions [duplicate]
This question already has an answer here : Closed 7 years ago . Possible Duplicate: SWIG Java Retaining Class information of the objects bouncing from C++ Question : Why is my C++ swigged object losing its type when passed to a Java callback function? Setup : I've taken the Swig Java example for doing callbacks and added an object to be passed to the callback run(Parent p) . The callback works as expected but when I pass a Child object the Java seems to lose its type and think its of type Parent when it should be Child . This is based on the Swig java callback example . System Info : Ubuntu 8