Xamarin Mac has a folder called Native References. However, when adding native static libraries (.a), it seems to do absolutely nothing. Ideally I would like to use T exported methods by using DllImport("__Internal"....)
How can I get this to work?
This a rather late reply, but just in case anyone else comes across this in the future, note that currently it is not possible to use static .a
libraries with Xamarin.Mac because Xamarin.Mac does not perform any native linking. That is, it does not invoke clang
or ld
at all during the build process. Instead, it just copies a pre-built "launcher" executable into the Contents/MacOS/
folder in the .app
bundle.
On the other hand, .dylib
libraries should work, as long as they're compiled for x86 and have all their dependencies. I recently wrote up a little guide on using dynamic libraries in Xamarin.Mac that might be helpful.
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