I saw this error when compiling the Music Shield code for ATMega328. The cause was that ATMega328 uses the following format for port names:
PORT + "letter" + "number" (ie. PORTB4)
instead of
P + "letter" + "number" (ie. PB4)
So all you have to do is to replace every occurrence of P[ABCD][1234] with PORT[ABCD][1234]