A wild guess on my part, but looking at your config statement, I'm guessing that you're
using the Hi-Tech PIC C compiler?

Hi-Tech has a web forum. I'm sure if you signup there someone will be happy to help you get
going, but you definitely will want to review the 877A data sheet.

You'll need to disable A/D to use some pins as digital I/O, and RA4 is an open-drain type
output.