/I (Additional Include Directories)
This page is specific to:.NET Framework Version:1.12.03.03.54.0
Visual C++ Compiler Options
/I (Additional Include Directories)
/I[ ]directory

where:

directory
The directory to be added to the list of directories searched for include files.

Remarks

This option adds a directory to the list of directories searched for include files. To add more than one directory, use this option more than once. Directories are searched only until the specified include file is found.

You can use this option with the Ignore Standard Include Paths (/X) option.

The compiler searches for directories in the following order:

  1. Directories containing the source file.
  2. Directories specified with the /I option, in the order that CL encounters them.
  3. Directories specified in the INCLUDE environment variable.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the General property page.
  4. Modify the Additional Include Directories property.

To set this compiler option programmatically

See AdditionalIncludeDirectories Property.

Example

The following command looks for the include files requested by MAIN.c in the following order: first in the directory containing MAIN.c, then in the \INCLUDE directory, then in the \MY\INCLUDE directory, and finally in the directories assigned to the INCLUDE environment variable.

CL /I \INCLUDE /I\MY\INCLUDE MAIN.C

See Also

Compiler Options | Setting Compiler Options

© 2009 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View