-qidirfirst

Category

Input control

Pragma equivalent

#pragma options [no]idirfirst

Purpose

Specifies whether the compiler searches for user include files in directories specified by the -I option before or after searching any other directories.

When -qidirfirst is in effect, the compiler first searches the directories specified by the -I option before searching any other directories. When -qnoidirfirst is in effect, before searching directories named on the -I option, the compiler first searches a) the directories in which source files named on the -qinclude option are located; and b) the directories in which the including files are located.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-noidirfirst-.   
>>- -q--+-idirfirst---+----------------------------------------><

Defaults

-qnoidirfirst

Usage

This option only affects files included with the #include “file_name" directive or the -qinclude option; -qidirfirst is independent of the -qnostdinc option and has no effect on the search order for XL C or system header files. (For the search order of header files, see Directory search sequence for include files.) This option also has no effect on files that are included using an absolute path name.

The last valid pragma directive remains in effect until replaced by a subsequent pragma.

Predefined macros

None.

Examples

To compile myprogram.c and search /usr/tmp/myinclude for included files before searching the current directory (where the source file resides), enter:
xlc myprogram.c -I/usr/tmp/myinclude -qidirfirst

Related information