• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Linking a static (.a) library into a framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Linking a static (.a) library into a framework
  • From: Eric Albert <email@hidden>
  • Date: Fri, 29 Oct 2004 13:53:11 -0700

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Linking a static (.a) library into a framework
      • From: Mike Laster <email@hidden>
References: 
 >Linking a static (.a) library into a framework (From: Mike Laster <email@hidden>)

  • Prev by Date: Linking a static (.a) library into a framework
  • Next by Date: Re: Linking a static (.a) library into a framework
  • Previous by thread: Linking a static (.a) library into a framework
  • Next by thread: Re: Linking a static (.a) library into a framework
  • Index(es):
    • Date
    • Thread