Compiler message

“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.


Go to:

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>:

#include <plib.h>

We benefit hugely from resources on the web so we decided we should try and give back some of our knowledge and resources to the community by opening up many of our company’s internal notes and libraries through mini sites like this. We hope you find the site helpful.
Please feel free to comment if you can add help to this page or point out issues and solutions you have found, but please note that we do not provide support on this site. If you need help with a problem please use one of the many online forums.


Your email address will not be published.