Cannot find plib.h MPLAB X IDE

2017-05-29_15h50_49

I had copied a project that was builder in older MPLAB X IDE 3.x which I was opening in freshly installed MPLAB X IDE 4.05 but it was complaining about not find plib.h library which was referenced in the code.

I did a couple of days of digging into and now found the problem using this microchip form post, which says

The installer “PIC32 Legacy Peripheral Libraries – Windows” from here
http://www.microchip.com/mplab/compilers
asks for the installation directory during installation, even if you have only one XC32 version installed.
In my case it proposes: C:\Program Files (x86)\Microchip\xc32\v1.40
which is “wrong”, because I only have v1.43 installed.

I.e. it proposed the wrong directory, and if you simply accept, it will use that wrong path.
As a consequence you cannot use the peripheral library (without changing project paths)

Install it again into your “current” compiler directory.
I could imagine its a bug, but they won’t fix it for the legacy PLIB.

which was exactly the problem. The problem was older version of MPLAB X IDE uses legacy drivers (plib) while they have been abandoned in the newer version. Verse legacy drivers are not shipped with the latest version of MPLAX X 4.05.

To sum up the problem for a newbie, to make older code work in the latest MPLAB X, you have to do the following.

  1. Install MPLAB X V4.05 (latest by today)
  2. Intall X32 C-Compiler (you have to download this sperate)
  3. Install “PIC32 Peripheral LIbrary” (You have to download it first)
  4. When you install PIC32 Peripheral Library, it will try to install itself in XC32/1.40 folder but you have to change that. This is the trick that you have to apply. Simply supply it the path to XC32 folder, which must already exist and continue with the installation.

That should solve your problem of “not finding plib.h” which is the peripheral library for legacy (older) MPLAB.

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s