简体   繁体   English

Xamarin iOS-绑定库时如何包括依赖项?

[英]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.

相关问题 在Xamarin.iOS中为2个依赖的静态库创建绑定 - Create binding for 2 dependent static libraries in Xamarin.iOS Xamarin - 点击时如何从列表视图中的 ImageCell 获取数据绑定字符串值? - Xamarin - How do i get data binding string value from an ImageCell in a listview when tapped? 如何在C#中包含C ++标头和库? - How do I include C++ header and libraries in C#? Win / Forms:如何在Advanced Installer中包括依赖项(DLLS) - Win/Forms: How do I include Dependencies (DLLS) in Advanced Installer 如何将 .deps 和 .runtimeconfig 文件包含为项目依赖项? - How do I include .deps and .runtimeconfig files as project dependencies? 在Xamarin中绑定iOS委托时出错 - Error when binding iOS delegate in Xamarin Xamarin.iOS没有导航栏时如何更改状态栏的颜色 - Xamarin.iOS how do I change the status status bar color when there is no Navigation bar 在 Xamarin Forms iOS 中使用 UIStringAttributes 时,如何获取 UITextView 的行高? - How do I get line heights of UITextView when using UIStringAttributes in Xamarin Forms iOS? Xamarin IOS UIActivityViewController ExcludedActivityTypes如何包含链接 - Xamarin IOS UIActivityViewController ExcludedActivityTypes how to include linked 如何在Xamarin(iOS和Android)应用程序中使用Windows名称空间? - How do I use Windows namespaces in Xamarin (iOS and Android) app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM