24.3.4 Include Search Paths

When you include a header file under the CCI, the file should be discoverable in the paths searched by the compiler that are detailed below.

Header files specified in angle bracket delimiters < > should be discoverable in the search paths that are specified by -I options (or the equivalent MPLAB X IDE option), or in the standard compiler include directories. The -I options are searched in the order in which they are specified.

Header files specified in quote characters " " should be discoverable in the current working directory or in the same directories that are searched when the header files are specified in angle bracket delimiters (as above). In the case of an MPLAB X project, the current working directory is the directory in which the C source file is located. If unsuccessful, the search paths should be to the same directories searched when the header file is specified in angle bracket delimiters.

Any other options to specify search paths for header files do not conform to the CCI.

Example

If including a header file, as in the following directive:

#include "myGlobals.h"

the header file should be locatable in the current working directory, or the paths specified by any -I options, or the standard compiler directories. A header file being located elsewhere does not conform to the CCI.

Differences

The compiler operation under the CCI is not changed. This is purely a coding guideline.

Migration to the CCI

Remove any option that specifies header file search paths other than the -I option (or the equivalent MPLAB X IDE option), and use the -I option in place of this. Ensure the header file can be found in the directories specified in this section.