And make sure that all your DEFINE statements are in upper case, ie:

Define LCD_DREG PORTD

should be

DEFINE LCD_DREG PORTD

(Skimask & Bruce pointed this out to me last week!)

Phil.