Date: Mon, 6 Feb 1995 10:50:45 -0500 (EST) From: Chris Tate To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: #include notation This is the last note I'll send out on this, I promise. :-) Anybody who still wants to talk about it, please revert to direct email. Bill Davidson (bdavidson AT ra DOT isisnet DOT com) wrote: > I know K&R 2 is not the ANSI standard, but it is close and it is what > many strive to duplicate. They make it clear that is a > UNIX-specific construct, but then gcc (and djgpp) is a UNIX compiler > ported to DOS. I think you will find on most systems. > > Q: where does the Mac start looking for headers; if you want to override > a standard header for one project, how do you do it? Both of the major IDEs on the Mac have the same behavior in this regard. The basic concept is that of "directory trees." There are two directory hierarchies that are searched for #included files - the tree rooted at the compiler application, and the tree rooted at the project file. These are called, respectively, the system tree and the project tree. Files #included via the <...> notation are searched for in the system tree. Files #included via the "..." notation are searched for first in the directory containing the file in which the #include directive is found, then in the project tree, then finally in the system tree. If you want to override a standard header, you #include it via the "..." notation, and put a copy (altered, presumably) in your project tree. There are other controls for the process; you can "shield" folders (subdirs) from being searched by a naming convention (make their names of the form "(...)"), and you can extend the system tree to span subdirectories outside the actual disk hierarchy rooted at the compiler application, by defining aliases to the desired folders (aliases are a Mac OS filesystem construct, roughly analagous to Unix file links). The newest (and currently most popular) IDE, Metrowerks CodeWarrior, allows this sort of restructuring of the system tree on a per-project basis, which means you have just as much control over the header search process as you do in a Make-based environment. -- Chris Tate fixer AT faxcsl DOT dcrt DOT nih DOT gov