Build failed with XC8 compiler: error the PIC18 extended instruction set was enabled
The error is pretty self-explanatory..


  config.h:13: error: (1504) the PIC18 extended instruction set was
  enabled


It means that the MPLAB XC8 compiler (which is based on the HI-TECH C compiler) does not support PIC18's extended instruction set.

Change this line:

#pragma config XINST = ON


to this:

#pragma config XINST = OFF


And it should work fine.



Additional info:


http://microchip.wikidot.com/faq:14
MPLAB® XC8 C Compiler User’s Guide:



  The compiler support all instruction sets for PIC10/12/16 devices as
  well as the standard (legacy) PIC18 instruction set. The extended
  instruction mode available on some PIC18 devices is not currently
  supported. Ensure you set the Configuration bits to use the PIC18
  legacy instruction mode when appropriate.