I am able to call C++ code from Java using SWIG but I can't find any documentation on how to do the reverse (call Java from C++).
The official SWIG documentation says (http://www.swig.org/Doc1.3/Java.html#java_overview): "SWIG enables a Java program to easily call into C/C++ code from Java. Historically, SWIG was not able to generate any code to call into Java code from C++. However, SWIG now supports full cross language polymorphism and code is generated to call up from C++ to Java when wrapping C++ virtual methods."
But I can't find where it says how to do it! Any help is greatly appreciated. Thank you.
Actually this is possible and I have implemented it based on inheriting a virtual class from C++ to Java.
You can find solution in chapter "24.5 Cross language polymorphism using directors" of Java part of SWIG document.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With