views:

126

answers:

1

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 ).

I have compiled this source as a linked library on my Mac with "make lib" which creates the libunrar.so file just fine.

These are the makefile settings for that target:

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.

Do I:

  • Compile it on the Mac with different make options then drag the resulting library (some kind of .a ?) into my xcode project? or
  • Drag all of the source code into my xcode project and create special targets of some kind to create it? 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.

Thanks for all advice.

A: 

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.

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.

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.

Here is a site that documents the process.

jessecurry