views:

41

answers:

1

I would like to use the libical library in my project, but I have never used an external library before. I have downloaded the libical files, but I am pretty much stuck there. I do not how how, or even if, I need to build/extract them and then how to get them into Xcode. Any help would be greatly appreciated. Thank you.

+1  A: 

If this a pre-built library then you can just drag it into your Xcode project (or use Project => Add to Project…) in the same way that you would for source/header files.

If it's not pre-built then you'll need to build it for whatever environments and architecture you want to target. If it comes with an Xcode project then this is easy. If it's just the usual open source type of distribution then you usually do something like this:

$ ./configure
$ ./make
$ sudo ./make install

That will typically put the built library(ies) and header(s) into somewhere like /usr/local/lib and /usr/local/include. In your main Xcode project you can then just add these header(s) and library(ies) to your project.

Note that if you're cross-compiling, e.g. for iPhone, then you'll need to add some flags to the ./configure command so that you target the correct architecture, e.g. ./configure -build=arm-apple-darwin9.0.0d1.

Note also that it's usually a good idea to check MacPorts to see if they have already fixed up a given open source project for Mac OS X - this can save you a lot of work.

See also this blog about building and using libical on iPhone.

Paul R
I am petty sure it is not pre-built as the downloaded files contain a vast array of files, most of which seem to be related to other languages. How would I build such a library?
Run Loop
@JK: OK - see additional comments in answer above.
Paul R
Thanks Paul, I'll give it a try.
Run Loop