• 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 linking in XCode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: static linking in XCode


  • Subject: Re: static linking in XCode
  • From: Chris Espinosa <email@hidden>
  • Date: Mon, 20 Feb 2006 11:17:20 -0800

On Feb 20, 2006, at 11:07 AM, Charles Francoise wrote:


Hi everyone,

i have this command line tool that works well on my computer. I tried it today on someone else's, and it said the dynamic libraries were missing. Apparently, for some reasons, Mac OS discourages static linking. Nonetheless, I wish to distribute my command line tool without everyone having to install the dynamic libraries. Is this possible ? I have the static versions of the libraries I use.

If you a) use the -lmyLib flag to link with your libraries (and that's what Xcode uses by default) and b) have both static and dynamic versions of the library in the same directory in your library search path, the linker has to pick one, and it picks the dynamic one. If you specifically want the static one, use -l/path/to/my/static/ library.a instead. In Xcode you'd remove the library from the target in the IDE, and add the specific -l line in Other Linker Flags.


Chris

_______________________________________________
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 linking in XCode (From: Charles Francoise <email@hidden>)

  • Prev by Date: static linking in XCode
  • Next by Date: xcode 2.x: How to link a framework to a specific build configuration?
  • Previous by thread: static linking in XCode
  • Next by thread: xcode 2.x: How to link a framework to a specific build configuration?
  • Index(es):
    • Date
    • Thread