“fatal error: plib.h: No such file or directory”
plib.h is no longer shipped with latest version XC32 compiler as of June 2017 (from V1.40). The peripherals “includes” are also no longer shipped.
Downloads tab > Current Peripheral Libraries
The Peripheral libraries requires the install of another software package.
For new projects
MPLAB Harmony – you should install for new projects as this is the new recommended way. Read the readme file – there is a step you have to do in MPLABX after install!
For old projects
Install “PIC32 Legacy Peripheral Libraries – Windows” from that page instead. During install when asked for the install directory change it to the one for your installed XC32 compiler (the “\v#.##” bit)
Now when you compile you will get this: “warning: #warning The PLIB functions and macros in this file will be removed from the MPLAB XC32 C/C++ Compiler in future releases”
To suppress this warning add this before your <include “plib.h>:
#define _SUPPRESS_PLIB_WARNING #include <plib.h>