Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linking a static (.a) library into a framework



On Oct 29, 2004, at 1:48 PM, Mike Laster wrote:

How do I go about linking a framework against a static .a library?

I'm trying to build a set of Objective-C wrappers around Spread (http://www.spread.org), but I don't want to introduce added dynamic dependancies.

I have a framework called Spread.framework that has my wrapper classes and links libspread.a which
is part of the project.


However, whenever I build it, Xcode seems to link /usr/local/libspread.dylib instead of the libspread.a which I told it to use. How to I make Xcode use the static library and not the dynamic one?

Pass the -search_paths_first flag to the linker. From the ld man page:

-search_paths_first
By default when the -dynamic flag is in effect, the -lx and
-weak-lx options first search for a file of the form
`libx.dylib' in each directory in the library search path, then
a file of the form `libx.a' is searched for in the library
search paths. This option changes it so that in each path
`libx.dylib' is searched for then `libx.a' before the next path
in the library search path is searched.


Hope this helps,
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Linking a static (.a) library into a framework (From: Mike Laster <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.