Set The Include Directory Path

Include Directory Paths

The Include Directory paths are used by the C compiler to find files referenced through #include directives. This is the preferred method of referencing include files that are not at the root of your project directory (as opposed to using relative paths in code: #include "subdirectory/filename.h").

1

Open the Project Properties Window

Either right click on the top node of the project in the Project window and select Properties from the pop-up window, or from the File menu, select Project Properties (ProjectName).

ProjectProperties.png
Click image to enlarge.

2

Select the Compiler Options

Select the C compiler from the Categories list on the left side of the Project Properties window. In this example, the XC16 compiler (xc16-gcc) is selected.

xc16gcc.png
Click image to enlarge.

3

Preprocessing and Messages Settings

Under the Option categories drop down menu select Preprocessing and messages

optioncategories.png
Click image to enlarge.

4

Add Include Directory Path(s)

Click on the text box next to the C include dirs item to open the C include dirs dialog box.

includedirs.png
Click image to enlarge.

5

Create a New Path

Click on the Browse button, to select the desired directory.

string.png
Click image to enlarge.
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.