3.5.18 How Do I Use Library Files in My Project?
The compiler will automatically include any applicable standard library into the build process when you compile, so you never need to control these files. See 3.2.5 How Do I Build Libraries? for information on how you build your own library files.
To use one or more library files that were built by yourself or a colleague, include them in the list of files being compiled on the command line. The library files can be specified in any position in the file list relative to the source files, but if there is more than one library file, they will be searched in the order specified in the command line. For example:
xc8-cc -mcpu=16f1937 main.c int.c lcd.a
If you are using MPLAB X IDE to build a project, add the library file(s) to the Libraries folder shown in your project, in the order in which they should be searched. The IDE will ensure that they are passed to the compiler at the appropriate point in the build sequence.