Adding dynamically linked shared library to Xamarin.iOS project

TylerKellyTylerKelly USMember ✭✭
edited May 2018 in Xamarin.iOS

I have been given several frameworks folders which each have the following tree:

├── SomeFrameWork.framework
│   ├── SomeFrameWork
│   ├── Headers
│   │   ├── SomeFrameWork.h
│   ├── Info.plist
│   └── Modules
│       └── module.modulemap

and SomeFrameWork has the type: Mach-O 64-bit dynamically linked shared library arm64. They were intended to work in Xcode, but I want them to work in Xamarin.iOS.

I am attempting to follow this guide by

1) adding SomeFrameWork to my project with command-option-a

2) adding the following to the additional mtouch arguments -gcc_flags "-L${ProjectDir} -SomeFrameWork -force_load ${ProjectDir}/SomeFrameWork"

3) I then add the following to my Main.cs:

ObjCRuntime.Dlfcn.dlopen("/Volumes/Samsung_T5/testiOS/testiOS/SomeFrameWork", 0);

4) I then try and access a function with the following signature: const framework_char_t * get_version_string() like so:

[DllImport("__Internal", EntryPoint = "get_version_string")]
public static extern string getVersion();

But when I go to rebuild my project, I get the clang warning:

Native linking Warning: clang: warning: argument unused during compilation: '-SomeFrameWork' [-Wunused-command-line-argument] (testiOS.iOS)

And when I attempt to deploy to my device, the application opens and then closes immediately, while the debugger continues to appear to work.

Any guidance would be greatly appreciated.

Sign In or Register to comment.