Unable to compile (build) code with MPLAB for PIC with CCS C compiler
The most immediate problem I can see is the following line of code:

#include " 16F877A.h "


You should remove the spaces because it's trying to open a file that contains spaces which is why you're getting multiple errors related to that file. While in general extra whitespace doesn't matter a lot in C / C++ code for any literals enclosed in quotes it certainly does.

Another area where you shouldn't insert extra spaces is also between operators such as == so the space between those two characters should be removed from line 10 as well so it should look like this:

if(x == 1) output_high(PIN_D0); // Change output