error opening a newly added liabrary in IDE


I just wanted to do some task which uses time so i found a library simpleTimer Arduino Playground - SimpleTimer Library
i added to the arduino ide and it was added successfully so i created a new sketch and tried to compile it on compiling i a getting following error

Arduino: 1.8.3 (Windows 7), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

In file included from C:\Users\JD-01\Documents\Arduino\timedActionLed\sketch_oct23a\sketch_oct23a.ino:1:0:

C:\Users\JD-01\Documents\Arduino\libraries\SimpleTimer-master/SimpleTimer.h:31:22: fatal error: functional: No such file or directory

 #include <functional>


compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

the sketch i added was just

#include <SimpleTimer.h>

I can tell you that it does compile for ESP8266. I suspect that the author didn't write the library for AVR or if they did they have a modified AVR hardware package.

I believe if you copy the original library code directly from Arduino Playground - SimpleTimer Library rather than the modified version of the library at GitHub - schinken/SimpleTimer: Fork of Arduino SimpleTimer Library ( you will find it compiles fine for your Mega 2560.

It's unfortunate that schinken didn't make any effort at documenting the limitations imposed by their modifications.

it is the same library which i have added it doesn't compile

Please read what I wrote again carefully. You installed the modified library on GitHub. If you had instead installed the original library code that is written on the Playground page by copying and pasting it to files you created then there is no way you would get that error message since line 31 of SimpleTimer.h is not

#include <functional>

and in fact that line doesn't occur anywhere in the Playground page library code.