#error freertos.h must be included before timer.h

I used MPLabX IDE. Can you try that?