Frameworks
Object-oriented frameworks are critical in Mac OS X. Indeed Cocoa, the object-oriented toolkit for user interface development, consists of the Foundation and Application Kit (or AppKit) frameworks for Objective-C and Java. It is often necessary to let the preprocessor know where to search for framework header files. You can do this with the -F option, which is also accepted by the linker. Thus:
-F directorynameinstructs the preprocessor to search the directory
directoryname
for
framework header files. The search begins in
directoryname and, if necessary, continues
in order in the following standard framework directories:
/Library/Frameworks (if the -no-cpp-precomp flag is specified)
/System/Library/Frameworks
To include a framework object header in Objective-C, use
#import. The format of the
#import preprocessor directive in your Objective-C
code is:
#import <frameworkname/headerfilename.h>
Here, frameworkname is the name of the
framework without the extension, and
headerfilename
.h is the
source for the header file.
The -F option is accepted by the preprocessor and the linker, and is used in either case to specify directories in which to search for framework header files. (This is similar to the -I option, which specifies directories to search for .h files.) By default, the linker searches the standard directories, /Local/Library/Frameworks and /System/Library/Frameworks, for frameworks. The directory search order can be modified with -F options. For example:
cc -F ...