• 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: -dynamiclib vs -dynamic vs -dylib
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -dynamiclib vs -dynamic vs -dylib


  • Subject: Re: -dynamiclib vs -dynamic vs -dylib
  • From: Eric Albert <email@hidden>
  • Date: Thu, 18 Dec 2003 00:03:43 -0800

At 2:23 AM -0500 12/17/03, Jeremy Bell wrote:
Not specific to xtools, but:
What is the -dynamiclib flag, and how is it different from -dynamic or -dylib? -dynamiclib is mentioned in the gcc man page (with a note to look at the ld man page) however the ld man page only contains a description of -dynamic and -dylib and not -dynamiclib. It seems BSD dynamic library targets in xcode default to using -dynamiclib rather than -dynamic now, so I just wondered if it just has the same effect as -dynamic.

-dynamic is a flag that both gcc and ld accept. gcc just passes it straight on to ld. It tells ld to build a dyanmically linked executable, as opposed to a statically linked one. It's turned on by default -- in fact, I don't think there's any official support for static executables on Darwin.


-dynamiclib is a gcc flag.  It tells gcc to pass -dylib to ld.

-dylib is an ld flag.  It tells ld to build a Mach-O dynamic shared library.

In other words, you should never have to use -dynamic. If you're building a dylib and using gcc to link (i.e. you're passing '-o lib<my_library>.dylib' to gcc), you'll use -dynamiclib. If you're building a dylib and using ld to link, you'll use -dylib.

Hope this helps,
Eric
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • find panel
      • From: Dirk Schelfhout <email@hidden>
    • Crash in Jaguar but not Panther
      • From: Ben Guthro <email@hidden>
References: 
 >-dynamiclib vs -dynamic vs -dylib (From: Jeremy Bell <email@hidden>)

  • Prev by Date: __frsqrte and __frsqrtes and -fast
  • Next by Date: Re: Xcode with .jar file
  • Previous by thread: -dynamiclib vs -dynamic vs -dylib
  • Next by thread: Crash in Jaguar but not Panther
  • Index(es):
    • Date
    • Thread