How can I use 64-bit integers on a PIC18?
64-bit datatypes are available to use but you must use the following flags when compiling:

--std=C99 --ext=cci


This makes the compiler use the C99 standard with the Common C Interface. With these compiler flags you will be able to use 64-bit integers.

However, it may require you to reformat your code as some C90 code will not play nicely with C99. It is worth searching through the Compiler Handbook for "CCI" too, as this also changes how you have to format your code (notably for interrupts).