Do I need to do anything to a project that includes user-defined libraries when porting this to XC8 compiler?

The MPLAB® XC8 compiler uses the LPP libraries for library routines written in C.

Do not mix the source code used to build a library. The .lpp libraries must be built from C source only, .lib libraries must be built from assembly source only. The .lpp libraries are passed to the code generator application, .lib libraries are passed to the linker application.

Using the compiler driver, libraries can be built by listing all of the files that are to be included in the library on the command line. None of these files should contain a main() function, nor settings for Configuration bits or any other such data. Use the --OUTPUT=lpp option to indicate that a library file is required.

Example:

xc8.exe --chip=16f877a lib_multiply.c lib_add.c --output=lpp

This creates a library file called lib_multiply.lpp and lib_add.lpp.

© 2025 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.