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