Header files not found

When creating a project for ESP32 there was no problem.
When creating a project for ESP8266 with board Generic Espressif ESP07S, the IDE doesn’t find some header files that should be there by default.
I really don’t understand the whole clutter in configuration files and if I should change anything in the “include” path settings. Everything always goes automatically so I never looked into this and never changed anything.
I re-opened the IDE, closed and re-opened the project.
I cleant the project.

Seems no one knows how to fix this anyway, but I give it a try on this forum.

The names of the header files are different for the ESP8266 than for the ESP32:

WiFi.hESP8266WiFi.h
ESPmDNS.hESP8266mDNS.h

See Arduino/libraries at master · esp8266/Arduino · GitHub