These options specify directories to search for header files, for libraries and for parts of the compiler:
-isystemfor that). If you use more than one
-Ioption, the directories are scanned in left-to-right order; the standard system directories come after.
If a standard system include directory, or a directory specified with
-isystem, is also specified with
-I, it will be
searched only in the position requested by
-I. Also, it will
not be considered a system include directory. If that directory really
does contain system headers, there is a good chance that they will
break. For instance, if GCC's installation procedure edited the headers
/usr/include to fix bugs,
-I/usr/include will cause the
original, buggy headers to be found instead of the corrected ones. GCC
will issue a warning when a system include directory is hidden in this
-Ioptions before the
-I-option are searched only for the case of
"; they are not searched for
If additional directories are specified with
-I options after
-I-, these directories are searched for all
directives. (Ordinarily all
-I directories are used
In addition, the
-I- option inhibits the use of the current
directory (where the current input file came from) as the first search
". There is no way to
override this effect of
-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.
-I- does not inhibit the use of the standard system directories
for header files. Thus,
The compiler driver program runs one or more of the subprograms
ld. It tries
prefix as a prefix for each program it tries to run, both with and
/ (see Target Options).
For each subprogram to be run, the compiler driver first tries the
-B prefix, if any. If that name is not found, or if
was not specified, the driver tries two standard prefixes, which are
/usr/local/lib/gcc-lib/. If neither of
those results in a file name that is found, the unmodified program
name is searched for using the directories specified in your
PATH environment variable.
The compiler will check to see if the path provided by the
refers to a directory, and if necessary it will add a directory
separator character at the end of the path.
-B prefixes that effectively specify directory names also apply
to libraries in the linker, because the compiler translates these
-L options for the linker. They also apply to
includes files in the preprocessor, because the compiler translates these
-isystem options for the preprocessor. In this case,
the compiler appends
include to the prefix.
The run-time support file
libgcc.a can also be searched for using
-B prefix, if needed. If it is not found there, the two
standard prefixes above are tried, and that is all. The file is left
out of the link if it is not found by those means.
Another way to specify a prefix much like the
-B prefix is to use
the environment variable
GCC_EXEC_PREFIX. See Environment Variables.
As a special kludge, if the path provided by
/, where N is a number in the range 0 to
9, then it will be replaced by
[dir/]include. This is to help
with boot-strapping the compiler.
specsfile, in order to override the defaults that the
gccdriver program uses when determining what switches to pass to
ld, etc. More than one
can be specified on the command line, and they are processed in order, from left to right.