If I put #include <ESP8266WebServer.h> in any file other than my main .ino file I get this error …
/root/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h:27:22: fatal error: functional: No such file or directory
#include <functional>
^
compilation terminated.
Can someone explain this? I tried deleting ~/.platformio and .pioenvs.
I found my problem. The accompanying file was named web.c. Changing it to web.cpp fixed it. I am surprised because I have used C files in C++ projects for years. I thought it was the compiler that mattered not any file extension. I wonder how .ino files work.