Callback virtual function from C++ to Go / Swig

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Callback virtual function from C++ to Go / Swig

Larry Bisel
I am trying to use SWIG to interface some Go code to a library that is written in C++.  The C++ library has a virtual callback function in a class:

class AbstractClass {
    virtual ~AbstractClass() {};
    virtual void AbstractCallback(Arg *arg) {}

I am using Go 1.7.4 and SWIG 3.0.10.  I want the C++ library to make a callback to my Go code.  I have tried to model my code after the example in Section 23.4.7 in the SWIG-3.0 Documentation, but I have not been able to get this to work.  I think my code is crashing the C++ library when the C++ library tries to make the callback, but I'm not exactly sure about that.  Do you have any additional pointers or ideas on how to debug this?



Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Swig-user mailing list
[hidden email]