Important: The information in this document is obsolete and should not be used for new development.
Using Stub Libraries at Build Time
Stub libraries are import libraries that export symbols but do not contain any code. Instead of linking against fully functional import libraries, you can link against a stub library, since all you need at build time is the definition of the library's API.Stub libraries are also useful when you have a circular dependency between import libraries. For example, if the library
mooLib
imports symbols fromcowLib
andcowLib
imports symbols frommooLib
, then a problem arises: you cannot buildmooLib
without linking withcowLib
and you cannot buildcowLib
without linking tomooLib
. The solution is to begin by linking against a stub version of one library. You can buildmooLib
by linking to a stub ofcowLib
(which allows you to resolve imports fromcowLib
), and then you can build the realcowLib
by linking it tomooLib.
© Apple Computer, Inc.
11 MARCH 1997