[MonoTouch] Binding issue
Jeff Stedfast
jeff at xamarin.com
Mon Mar 5 01:22:31 UTC 2012
Hi Morph,
The LinkWith attribute doesn't statically link your native library with the
binding assembly. All it does is embed it (and the necessary linker flags)
so that you (or whoever uses your binding) doesn't have to figure out the
linker flags to use with his app project (assuming the correct values were
set on the LinkWith attribute, of course).
When you build your app project that references the binding assembly, the
mtouch tool extracts the native library and reads the LinkWith metadata to
figure out the appropriate linker flags to use when statically linking the
native library that it just extracted into your final app executable.
I need to see the gcc commands to make sure that there isn't some sort of
bug in the way mtouch adds those linker flags to gcc's linker command-line.
One thing you can try is adding LinkerFlags="-ObjC" to your LinkWith
attribute and seeing if that solves anything.
If you wrote the native library (or have the source code for it), you could
also try adding some NSLog() calls inside of the native library in the
methods you call to see if they are actually being invoked. If those
NSLog() calls do not get hit, then it's a sign that you didn't get the
LinkWith attribute properties correct.
Jeff
On Sun, Mar 4, 2012 at 8:11 PM, Morph268 <angriawan at hotmail.com> wrote:
> Interesting, I didn't know that you need to also statically link the native
> library to your app project.
>
> I thought the binding assembly already contains both the binding and the
> native library.
>
> I will try it later and let you know.
>
> Thank you,
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Binding-issue-tp4434091p4444812.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monotouch/attachments/20120304/d9054768/attachment.html>
More information about the MonoTouch
mailing list