Next: , Previous: Link Options, Up: Invoking GCC

3.14 Options for Directory Search




Add the directory dir to the head of the list of directories to be searched for header files only for the case of `#include "file"'; they are not searched for `#include <file>', otherwise just like -I.

The compiler driver program runs one or more of the subprograms cpp, cc1, as and ld. It tries prefix as a prefix for each program it tries to run, both with and without `machine/version/' (see Target Options).







Use dir as the logical root directory for headers and libraries. For example, if the compiler would normally search for headers in /usr/include and libraries in /usr/lib, it will instead search dir/usr/include and dir/usr/lib.

If you use both this option and the -isysroot option, then the --sysroot option will apply to libraries, but the -isysroot option will apply to header files.

The GNU linker (beginning with version 2.16) has the necessary support for this option. If your linker does not support this option, the header file aspect of --sysroot will still work, but the library aspect will not.

This option has been deprecated. Please use -iquote instead for -I directories before the -I- and remove the -I-. Any directories you specify with -I options before the -I- option are searched only for the case of `#include "file"'; they are not searched for `#include <file>'.

If additional directories are specified with -I options after the -I-, these directories are searched for all `#include' directives. (Ordinarily all -I directories are used this way.)

In addition, the -I- option inhibits the use of the current directory (where the current input file came from) as the first search directory for `#include "file"'. There is no way to override this effect of -I-. With -I. you can specify searching the directory which was current when the compiler was invoked. That is not exactly the same as what the preprocessor does by default, but it is often satisfactory.
