Re: Linking cocoa to UNIX library
Re: Linking cocoa to UNIX library
- Subject: Re: Linking cocoa to UNIX library
- From: James Quick <email@hidden>
- Date: Mon, 21 Jul 2003 17:30:14 -0400
On Monday, July 21, 2003, at 01:38 PM, Erik Fears wrote:
Hello,
I've got a UNIX library that I want to compile, link to, and distribute
with a cocoa program. Can anyone recommend the best way about linking
this to my cocoa app? One possibility is to just link all of the source
files into my app (without using it as a library). Another possibility
would
be to setup XCODE to build it as a static library and then link it
(I have no clue how to do this in XCODE).
If the Unix library is legacy, and very stable not actively being
maintained
by other developers, I would import the sources in a subdirectory of
your
project directory, then create an additional target in Xcode.
If you want this target to be a static library you probably just want
to use
a makefile to to handle the .c.o phase and maintain the libfoo.a. Then
create the dependency in Xcode, add the -l and -L flags to your compiler
settings in the other target and you are good to go.
There is nothing stopping you from making into a framework either,
though,
and honestly I would prefer this approach for many reasons.
If it is being actively maintained, however I would try to depend only
on the
end result rather than the source files, since all the file references
would
be subject to change. In that event though, Just copy the lib into
place
in a copy phase, and link to it with a relative path if it is a shared
lib.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.