[英]Xamarin iOS - How do I include dependencies when binding libraries?
I have an Obj-C native library libCMX.a
that I wish to create C# bindings for, but the library has multiple dependencies, eg JASidePanels with a couple of .m
and .h
files. 我有一个Obj-C本机库
libCMX.a
,希望为其创建C#绑定,但是该库具有多个依赖项,例如JASidePanels带有两个.m
和.h
文件。
How can I include these in the Xamarin binding project so they are linked correctly into the resulting DLL? 如何将它们包含在Xamarin绑定项目中,以便它们正确链接到生成的DLL中?
I know I can specify Frameworks
in the LinkWith
attribute, but how do I include pure code dependencies in form of main and header files? 我知道我可以在
LinkWith
属性中指定Frameworks
,但是如何以主文件和头文件的形式包含纯代码依赖项?
EDIT: The library is proprietary (Cisco CMX SDK), I do not have access to the source code. 编辑:该库是专有的(Cisco CMX SDK),我无权访问源代码。
EDIT 2: The library is part of a framework (CMX.framework), from which I have extracted the extensionless archive and renamed it to libCMX.a to match default library naming for Xamarin. 编辑2:该库是框架(CMX.framework)的一部分,我从中提取了无扩展档案,并将其重命名为libCMX.a以匹配Xamarin的默认库命名。
You can reference multiple native libraries in your binding project, the combined set of libraries will be linked into your application. 您可以在绑定项目中引用多个本机库,合并的库集将链接到您的应用程序中。
You only need to surface the APIs for libraries that you want to invoke/call. 您只需要公开要调用/调用的库的API。 For the rest, just include the binary dependencies.
对于其余的,仅包括二进制依赖项。
您将需要将它们编译到要绑定到C#的静态库(libMyLibrary.a)中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.