Just sharing a bug I found in the MC XC8 2.32. also 2.40 .
Symptoms .. PIC18F57Q43 code complied but with many errors and warnings . check the #include <xc.h> line. [ The PORTE didn't work ]
Fix.. the plib file was missing from the XC8 directory, I took a guess and copied and renamed the lib file into the 2.40 include directory as plib . Code compiles now without the ‘red weed ‘of errors. ( fix is right picture ) .
( I'm running linux.mint 20 . MPLABX 6.0) .
Yes, it gets the device from the IDE project settings which is then passed to XC8 as a command-line parameter.
As stated, if it compiles then "xc.h" isn't failing to find the .inc file, only the IDE.
The IDE has a different idea of what the search paths are than the ones the compiler uses.
What the IDE thinks doesn't matter.