• 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: Linker fails to link in static library
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linker fails to link in static library


  • Subject: Re: Linker fails to link in static library
  • From: Philip White <email@hidden>
  • Date: Mon, 17 Jan 2011 17:35:01 -0600


On Jan 17, 2011, at 5:00 PM, Xochitl Lunde wrote:


I add the resulting library to another
> project, make sure it is listed in the "Link Binary with Libraries"
> phase for the appropriate target, and try to build, but the linker
> gives me an error for every reference to a function from the library.
>

What happens if you add the library path to "Library Search Paths" and add "-lyourlib" to "Other Linker Flags" field?  Will it link then? You could also add the full path to "Other Linker Flags" field: "$path/path/yourlib.a" (This should be approx. the same thing as adding it to the "Link Binary with Libraries" field, but just for the sake of determining if something else will work you can try it.)

Could your dependencies be out of order?

Could you be building this new library only for 1 architecture, but not the first architecture that tries to link?  Should be able to run $> file yourlib.a and see what architectures it built for and whether or not Xcode REALLY built a static library, or if it built a dynamic library with a .a file extension.  In your library info it should say "Mach-O Type" = Static Library (I think).

Also, I tried reordering the linking order in various ways with any effect.

Thanks,
  Philip
 _______________________________________________
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

References: 
 >Re: Linker fails to link in static library (From: Xochitl Lunde <email@hidden>)

  • Prev by Date: Re: Linker fails to link in static library
  • Next by Date: Re: Linker fails to link in static library
  • Previous by thread: Re: Linker fails to link in static library
  • Next by thread: Re: Linker fails to link in static library SOLVED
  • Index(es):
    • Date
    • Thread