Loosing your Head(er)

Contrary to what most MPLAB users believe, the “Headers” folder in MPLAB  Project window is not affecting the compiler selection and access to .h files. It is there merely to let you access them quickly and open them in the editor window.
If you want to make sure that the compiler finds the .h files you are using you have to make sure to do one of two things:
A) Put the .h files (or copies) in the main project directory and use:
#include “xxx.h” (note the use of quotes).
or
B) Make sure to add the directory(-ies) where the .h files are to the “include search path” list in the Build Options for Project Dialog Box. Now you can use #include <xx.h> (note the angled brackets used as quotes)

Method A) is used for simplicity in the first half of the book.

Method B) is used in the second half of the book as we start building more advanced modules/libraries. The steps to add the include directory path to the Build Options for Project Dialog box are described in Chapter 10 (Day 10) page 238 and following…

Don’t loose your head(er)…

This entry was posted in PIC32. Bookmark the permalink.