"Warning peripheral library support is missing for the 18F45K22"
Right click project > properties > Conf: -> XC8 global options -> XC8 linker
"Link in Peripheral Library" is causing it if set, but if you are using peripheral library functions you need this. There seems to be some issue with XC8 no longer shipping with the peripheral libraries – yet more microchip rubbish making what should be simple infuriatingly hard. If you have another version of the compiler try that, or see if you can download the peripheral library element. A good check to see if you have it is to look in:
C:\Program Files (x86)\Microchip\xc8\v#.##\docs\
If "MPLAB_XC8_Peripheral_Libraries.pdf" is not there then they are likely not installed for that version.