StephenJStarkie
2015-10-01 15:36:28 UTC
Hi, (this is a repost after subscribing to the list properly! sorry)
We have a body of code already using SWIG for Java (for Android mainly) from
a common C++ code base. This uses a IXXXXListener 'interface' (pure
abstract class in C++) to call back up to Java from the C++. This all works
well. However, I am now trying to make this work with C# in order to work
with Xamarin for iOS (and Android) and am having a problem with the
delegates that the SWIG director creates for C#. When I run I get an error:
Attempting to JIT compile method '(wrapper native-to-managed)
XXXXXX.IXXXXListener:SwigDirectoronXXXXX ()' while running with --aot-only.
See http://docs.xamarin.com/ios/about/limitations for more information.
The Xamarin documentation talks about applying the MonoPInvokeCallback
attribute wherever a delegate is provided to the native code (which I
understand; there can be no JIT on iOS). It also says that these need to be
static. I have done this as necessary and documented elsewhere for the
exceptions
(http://blog.reblochon.org/2013/01/c-bindings-for-monotouch-using-swig.html),
but it's not obvious how to do this with the director code that SWIG
generates.
Does anyone have any ideas? Can I make SWIG produce more Java-like wrappers
for C# directors? Or how would I go about turning the generated code into
statics that could be decorated with the appropriate attribute?
Thanks,
Steve
--
View this message in context: http://swig.10945.n7.nabble.com/C-directors-from-C-with-Xamarin-iOS-repost-tp14534.html
Sent from the swig-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------
We have a body of code already using SWIG for Java (for Android mainly) from
a common C++ code base. This uses a IXXXXListener 'interface' (pure
abstract class in C++) to call back up to Java from the C++. This all works
well. However, I am now trying to make this work with C# in order to work
with Xamarin for iOS (and Android) and am having a problem with the
delegates that the SWIG director creates for C#. When I run I get an error:
Attempting to JIT compile method '(wrapper native-to-managed)
XXXXXX.IXXXXListener:SwigDirectoronXXXXX ()' while running with --aot-only.
See http://docs.xamarin.com/ios/about/limitations for more information.
The Xamarin documentation talks about applying the MonoPInvokeCallback
attribute wherever a delegate is provided to the native code (which I
understand; there can be no JIT on iOS). It also says that these need to be
static. I have done this as necessary and documented elsewhere for the
exceptions
(http://blog.reblochon.org/2013/01/c-bindings-for-monotouch-using-swig.html),
but it's not obvious how to do this with the director code that SWIG
generates.
Does anyone have any ideas? Can I make SWIG produce more Java-like wrappers
for C# directors? Or how would I go about turning the generated code into
statics that could be decorated with the appropriate attribute?
Thanks,
Steve
--
View this message in context: http://swig.10945.n7.nabble.com/C-directors-from-C-with-Xamarin-iOS-repost-tp14534.html
Sent from the swig-user mailing list archive at Nabble.com.
------------------------------------------------------------------------------