That darned clib.lib

After poring over numerous errors… NOT EVEN CODE ERRORS! I’m using default 2007 code trying to get it to compile, but I had a large number of problems. After fixing many of them, I have narrowed it down to 1. I get the stupid error that MPLAB couldnt find clib.lib. I have MPLAB 7.20 and C18 2.40. I did a search on my entire computer for all *.lib files. Only 12 hits thankfully, but I did not have the clib.lib anywhere.

Could someone direct me to where I can get this clib.lib? where to put it? Or anything that might fix my problem that I wasn’t thinking of.


I had that same problem about a month ago. It has to do with MPLab not recognizing the compiler. I was getting the message because I installed MPLab after the C18 compiler, and you really need to do it in the other order.

There might be a way to fix it by changing something in your build options or something, but I don’t know what exactly, so I uninstalled the C18 compiler, and reinstall it, and it worked.

By default it’s C:\mcc18\lib if it isn’t there, I would suggest reinstalling the c18 complier.

You usually get this error if your MPLAP project doesn’t have the right library path set.

You need to go to the project menu then build options then project
On the directory tab select Library Search Path, create a new one that points to the mcc18\lib folder where ever that may be, it might be in C:\Program Files\ or just under C:\

I uninstalled it and reinstalled it and finally I have clib.lib. I checked before I uninstalled and I DID NOT have a lib folder in my mcc18 folder which was under C:\Program files\Microchip\mcc18…and then nothing useful.

I dont know how it happened but fixed now.

You, my friend, have just saved me an enormous amount of time and aggravation! Works perfectly now. Thanks.

Thank you so much! I wasted three hours working on this.