简体   繁体   English

如何在我的iPhone应用程序中包含开源库?

[英]How would I include open source library in my iPhone application?

I have found an existing open source library that I would like to include in my iPhone project (the unrar source code found here: http://www.rarlab.com/rar_add.htm ). 我已经找到了一个现有的开源库,希望将其包含在我的iPhone项目中(此处找到了unrar源代码: http : //www.rarlab.com/rar_add.htm )。

I have compiled this source as a linked library on my Mac with "make lib" which creates the libunrar.so file just fine. 我已经使用“ make lib”在Mac上将此源编译为链接库,该库可以很好地创建libunrar.so文件。

These are the makefile settings for that target: 这些是该目标的makefile设置:

lib:    WHAT=RARDLL
lib:    $(OBJECTS) $(LIB_OBJ)
        @rm -f libunrar.so
        $(LINK) -shared -o libunrar.so $(LDFLAGS) $(OBJECTS) $(LIB_OBJ)

Obviously I can't use this on iPhone but I imagine I should be able to compile with different options to make a static library that I can use. 显然,我不能在iPhone上使用它,但我想我应该可以使用不同的选项进行编译,以创建可以使用的静态库。

Do I: 我要:

  • Compile it on the Mac with different make options then drag the resulting library (some kind of .a ?) into my xcode project? 在Mac上使用不同的make选项进行编译,然后将生成的库(某种类型的.a?)拖到我的xcode项目中? or 要么
  • Drag all of the source code into my xcode project and create special targets of some kind to create it? 将所有源代码拖到我的xcode项目中并创建某种特殊目标来创建它? or 要么
  • Something else entirely different? 还有其他完全不同的东西吗?

I've been working on solving my unrar problem for a couple of weeks now and I believe using this library will give me the best results but I just don't know the final steps to make use of it. 我已经在解决我的unrar问题上工作了几周了,我相信使用这个库将给我最好的结果,但是我只是不知道使用它的最终步骤。

Thanks for all advice. 感谢您的所有建议。

I think that you'll probably want to do the easiest thing first, create an empty iPhone project and bring all of the code into it, just to see if it will compile. 我认为您可能首先想做最简单的事情,创建一个空的iPhone项目并将所有代码放入其中,只是看它是否可以编译。

If so, you may want to use the empty project to aid in the development of an Objective-C wrapper, once that is complete you can bring the code into your existing project for integration and testing. 如果是这样,您可能希望使用空项目来帮助开发Objective-C包装器,一旦完成,您就可以将代码带入现有项目中进行集成和测试。

If it looks like this is code that you would like to use with other projects, or you are feeling giving and would like to provide an iPhone port of the code, go ahead and pull this together into a library. 如果看起来这是您希望与其他项目一起使用的代码,或者感觉很给力并且想提供该代码的iPhone端口,请继续将其合并到一个库中。

Here is a site that documents the process. 这是一个记录该过程的站点

暂无
暂无

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

相关问题 如何将iPhone库与iPhone应用程序连接? - How can I connect iphone library with my iPhone application? 如何在iPhone应用程序中包含字体? - How do I include a font with my iPhone application? 如何在我的iphone应用程序中打开设备映射以在源和目标之间绘制路径? - How to Open device map in My iphone Application for Draw path between Source and Destination? 如何将所有照片从iPhone照片库读取到应用程序中,我将如何获取照片库的路径? - How to read all images from iphone photo library into application and how i would i get path of photo library? 如何查看在iPhone上显示的网页来源? - How can I see the source of a webpage as it would be displayed on an iPhone? Zxing on iphone:如何在我的应用程序中扫描qrcode而不包含zxing小部件? - Zxing on iphone: how can i scan qrcode without include zxing widget in my application? 为 iPhone 构建开源库 (liblo) - Building open source library (liblo) for iPhone 如何从我自己的应用程序打开iPhone邮件应用程序? - How to open iphone mail application from my own application? 将音频文件从iPhone音频库保存到应用程序文档文件夹时,如何减小音频文件的大小? - How to reduce the size of audio file when I save it from iphone audio library to my application document folder? 在哪里可以找到开源Wikipedia iPhone应用程序的来源? - Where can I find the source of the open-source Wikipedia iPhone application?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM