0

From Xamarin docs at https://developer.xamarin.com/guides/ios/advanced_topics/native_interop/, it appears the following flags must be specified for the main iOS project:

-cxx -gcc_flags "-L${ProjectDir} -lMylibrary -lSystemLibrary
-framework CFNetwork -force_load ${ProjectDir}/libMyLibrary.a"

However, this article is a bit dated. Is the process still the same for Visual Studio 2015? Where exactly do I specify these flags? Does it go in Project --> Properties --> iOS Build --> Additional mtouch arguments?

Also, Visual Studio has a standard output directory for each project in a solution. How does my library file get copied to $(ProjectDir)? Regards.

Peter
  • 11,260
  • 14
  • 78
  • 155

1 Answers1

1

Does it go in Project --> Properties --> iOS Build --> Additional mtouch arguments?

Yep. I found this link to be somewhat helpful when considering what's available to me.

How does my library file get copied to $(ProjectDir)?

Assuming you are already connected to your Macbook, when you build the Xamarin Agent copies your files into a cache directory on the Mac. For me, this was here:

/Users/myname/Library/Caches/Xamarin/mtbs/ (hidden)

You will need to include your libraries in your project, which I did here as a Native Static Reference. This was simpler for me than using a Binding. However you do it, once your libraries are included in the iOS project, they will be copied into that cache directory on build. Note that they might be in a subdirectory of that cache, requiring you to modify your ${ProjectDir}/libMyLibrary.a argument in gcc_flags.

I know this is an old question, but I hope somebody can get some use from it.

Joseph
  • 903
  • 1
  • 10
  • 25