On May 19, 8:36 pm, Fred <fred.l.kleinschm...@boeing.comwrote:
Quote:
On May 17, 7:01 pm, pcs...@yahoo.com (Pablo Suarez) wrote:
Quote:
Quote:
#include "myheader.h"
Quote:
Quote:
then this header file is searched in the current directory.
Quote:
Almost. It is *first* looked for in the current directory.
If not found, it *may* be looked for in other places,
according to implementation-dependent rules.
It's very much compiler dependent, but I don't know of any which
look in the current directory (unless you specifically tell the
compiler to do so).
Quote:
Quote:
But where does the compiler search the header file when I write
Quote:
Quote:
#include <myheader.h>
Quote:
It is looked for in implementation-defined "standard" directories.
ON *nix, this is usually /usr/include.
Again, it's very implementation dependent, and almost always
includes more than just /usr/include.
Quote:
Also, most compilers allow command-line options to specify
additional directories to be searched BEFORE the standard place(s),
using the -I option:
cc -I/MyDirectory -I/MyOtherDirectory ...
Quote:
These directories will be searched for with either of the
#include styles.
The rules say that for an "..." include, if the search fails,
the compiler must then treat it as a <...include.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34