• 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 vs dylib lib linking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static vs dylib lib linking


  • Subject: Re: static vs dylib lib linking
  • From: Hugh Hoover <email@hidden>
  • Date: Fri, 23 Feb 2007 10:24:46 -0800


On Feb 22, 2007, at 12:50 PM, Dave Dribin wrote:

On Feb 22, 2007, at 12:59 PM, Kevin Packard wrote:
What is the correct way to specify linking with "libfoo.a" instead of "libfoo.dylib" if both libraries reside in the same directory?

A way I've found that works well is to specify a the full path to the .a as a custom linker flag. Basically, you want your linker command line to look like this (notice no `-l` on the libfoo.a):


% ld -o output <object files> /full/path/to/libfoo.a -l<dynamic library>

I've used this when I have a newer version of a system library that I want to statically link against.


Another workaround is to remove or rename any dylib of the same name, so you get -lfoo in the ld, but there is no libfoo.dylib, so it HAS to link against the libfoo.a.




_______________________________________________ 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: static vs dylib lib linking
      • From: Kevin Packard <email@hidden>
References: 
 >static vs dylib lib linking (From: Kevin Packard <email@hidden>)
 >Re: static vs dylib lib linking (From: Dave Dribin <email@hidden>)

  • Prev by Date: Re: template C++ mailing lists
  • Next by Date: How do I access DiskArbitration from Panther AND Tiger?
  • Previous by thread: Re: static vs dylib lib linking
  • Next by thread: Re: static vs dylib lib linking
  • Index(es):
    • Date
    • Thread