• 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: static libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static libraries


  • Subject: Re: static libraries
  • From: Steve Checkoway <email@hidden>
  • Date: Sat, 22 Oct 2005 12:16:59 -0700

On Oct 22, 2005, at 6:28 AM, Andreas Grosam wrote:


On 22.10.2005, at 04:42, Steve Checkoway wrote:



On Oct 21, 2005, at 7:01 PM, Andreas Grosam wrote:

If you just pass -L/path/to -lfoo and expect it to give use /path/ to/libfoo.a and there is a dynamic library with the same name elsewhere, it'll get picked up unless you instruct ld otherwise by using -search_paths_first. Since gcc doesn't know about that, you have to use -Wl, to pass it along.


You are right, i missed that.

But unfortunately this too does not *always* solve the problem in all cases:
Assuming, dynamic linking is in effect (the default) and you specified the lib via -lx


The algorithm is as follows:
[...]

The order for library search path is:
first all paths specified with -L, then standard library dirs (/ lib, /usr/lib, /usr/local/lib/)
If -Z is specified, then ld will not search in standard paths.
The search order of paths specified with -L is not documented, though.



So, if ld searches in any path where ld can locate a dylib, it will select this first - no matter what you have dragged in into your project. Xcode just takes the canonical name and passes it to ld (through gcc).


In order to avoid conflicts, we probably need to specify full paths and full names. *sigh*

Yeah. =( I assume this has been filed as a bug before.




And yet another one: the behavior of ld, say search order of lib paths and available options is platform dependend, so when you use option -K you have no luck on Mac OS X.

-K ?

- Steve

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >static libraries (From: Steve Checkoway <email@hidden>)
 >Re: static libraries (From: Andreas Grosam <email@hidden>)
 >Re: static libraries (From: Steve Checkoway <email@hidden>)
 >Re: static libraries (From: Andreas Grosam <email@hidden>)

  • Prev by Date: Re: reverse searching
  • Next by Date: Re: Speeding up XCode?
  • Previous by thread: Re: static libraries
  • Next by thread: Re: static libraries
  • Index(es):
    • Date
    • Thread