Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Mac OS Runtime Architectures /
Chapter 3 - Programming for the CFM-Based Runtime Architecture


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 from cowLib and cowLib imports symbols from mooLib, then a problem arises: you cannot build mooLib without linking with cowLib and you cannot build cowLib without linking to mooLib. The solution is to begin by linking against a stub version of one library. You can build mooLib by linking to a stub of cowLib (which allows you to resolve imports from cowLib), and then you can build the real cowLib by linking it to mooLib.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 MARCH 1997