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
mooLibimports symbols fromcowLibandcowLibimports symbols frommooLib, then a problem arises: you cannot buildmooLibwithout linking withcowLiband you cannot buildcowLibwithout linking tomooLib. The solution is to begin by linking against a stub version of one library. You can buildmooLibby linking to a stub ofcowLib(which allows you to resolve imports fromcowLib), and then you can build the realcowLibby linking it tomooLib.
![]()
![]()
![]()
![]()
© Apple Computer, Inc.
11 MARCH 1997