简体   繁体   English

如何确定我的静态库是否工作正常

[英]How to make sure whether my static library works fine

We are developing a Xamarin iOS application by making use of SUP MBOs. 我们正在通过使用SUP MBO开发Xamarin iOS应用程序。 We have generated the code in Objective C and in order to access it from C# code base(Xamarin), this generated code should be bundled as a static library (.a file) with some SUP specific static libraries and SUP header classes. 我们已经在Objective C中生成了代码,并且为了从C#代码库(Xamarin)中访问代码,应将此生成的代码捆绑为一个静态库(.a文件),其中包含一些SUP特定的静态库和SUP标头类。 We are able to create universal static library file(.a file) with help of Build fat static library (device + simulator) using Xcode and SDK 4+ 我们可以使用Xcode和SDK 4+通过构建胖静态库(设备+模拟器)来创建通用静态库文件(.a文件)。

Now my question is how to make sure whether the universal static library file which we have created is working or not? 现在我的问题是如何确定我们创建的通用静态库文件是否正常工作?

We have created a sample static library file by just implementing a add method and were able to access it through C# code(using Xamarin) but we are getting this error -## MT5211: Native linking failed, undefined Objective-C class: _OBJC_CLASS ## when using SUP generated code. 我们仅通过实现一个add方法就创建了一个示例静态库文件,并且能够通过C#代码(使用Xamarin)对其进行访问,但是却遇到此错误-## MT5211:本机链接失败,未定义的Objective-C类:_OBJC_CLASS# #使用SUP生成的代码时。 we are giving all correct values to all properties in build setting of Xcode "other linker flags", "library search path", "header search path" but I have no idea how we can go ahead with this. 我们在Xcode的“其他链接器标志”,“库搜索路径”,“标题搜索路径”的构建设置中为所有属性提供了所有正确的值,但是我不知道如何进行此操作。 We are not sure whether we are missing something or in wrong path? 我们不确定我们是否缺少某些东西或走错了路?

The best option is to create a Binding project for the native library (and a corresponding test application that exercises the binding project to make sure it works). 最好的选择是为本机库创建一个绑定项目 (以及一个相应的测试应用程序,该应用程序将执行绑定项目以确保其正常工作)。

If you have any problems (build/linker/runtime errors), we'll need to see the header file, the binding code you've created and the full build output in order to diagnose the problem properly. 如果您有任何问题(构建/链接器/运行时错误),我们将需要查看头文件,创建的绑定代码以及完整的构建输出,以便正确地诊断问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM