Sun Studio 12: C++ User's Guide

A.2.36 -Ipathname

Add pathname to the #include file search path.

This option adds pathname to the list of directories that are searched for #include files with relative file names (those that do not begin with a slash).

The compiler searches for quote-included files (of the form #include "foo.h") in this order.

  1. In the directory containing the source

  2. In the directories named with -I options, if any

  3. In the include directories for compiler-provided C++ header files, ANSI C header files, and special-purpose files

  4. In the /usr/include directory

The compiler searches for bracket-included files (of the form #include <foo.h>) in this order.

  1. In the directories named with -I options, if any

  2. In the include directories for compiler-provided C++ header files, ANSI C header files, and special-purpose files

  3. In the /usr/include directory


    Note –

    If the spelling matches the name of a standard header file, also refer to 12.7.5 Standard Header Implementation .


A.2.36.1 Interactions

The -I- option allows you to override the default search rules.

If you specify -library=no%Cstd, then the compiler does not include in its search path the compiler-provided header files that are associated with the C++ standard libraries. See 12.7 Replacing the C++ Standard Library.

If –ptipath is not used, the compiler looks for template files in –Ipathname.

Use –Ipathname instead of –ptipath.

This option accumulates instead of overrides.

Warnings

Never specify the compiler installation area, /usr/include, /lib, or /usr/lib, as search directories.

See also

-I-