Maybe your compiler is set for the wrong target processor?
e.g. written for a MEGA1284P, compiled for a 328p ?