I am working on DOIT ESP32 DEVKIT V1 and I'm using Arduino IDE 1.8.13 (Windows 10 Pro Education x64) for coding this board. I installed the ESP32 board (and ESP8266) as well from the boards manager inside Arduino IDE. It was working fine for some days, until, a friend sent me an .ino file and after opening it and trying to compile and upload that file on my board, a weird compilation error occurred (it's the same error that occurred on my friend's system, and she had to switch to another system to continue working smoothly). I am using these URLs in Additional Boards Manager URLs option under preferences in Arduino IDE:
https://dl.espressif.com/dl/package_esp32_index.json, http://arduino.esp8266.com/stable/package_esp8266com_index.json
And the following error messages appear on compilation:
In file included from c:\programdata\matlab\supportpackages\r2018a\3p.instrset\arduinoide.instrset\idepkgs\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\algorithm:60:0,
from C:\ProgramData\MATLAB\SupportPackages\R2018a\3P.instrset\arduinoide.instrset\idepkgs\packages\esp32\hardware\esp32\1.0.6\cores\esp32/Arduino.h:142,
from sketch\sketch_aug21a.ino.cpp:1:
c:\programdata\matlab\supportpackages\r2018a\3p.instrset\arduinoide.instrset\idepkgs\packages\esp32\tools\xtensa-esp32-elf-gcc\1.22.0-97-gc752ad5-5.2.0\xtensa-esp32-elf\include\c++\5.2.0\utility:68:28: fatal error: bits/c++config.h: No such file or directory
compilation terminated.
exit status 1
Error compiling for board DOIT ESP32 DEVKIT V1.
Please provide me a step by step guide to fix this issue, as I am new to such errors and directory issues. Note that there are no compilation errors when I select Arduino AVR Boards (such as MEGA, UNO, etc.). I have already tried re-installing the ESP32 board from boards manager, but no success.
FIXED! The problem was that there were no /hardware/espressif/esp32 folders existing anywhere, even though the board support was installed. So I removed the board from Arduino's Board Manager, created the folders myself, and installed the ESP32 core there. I followed all the instructions given over this link: https://learn.sparkfun.com/tutorials/esp32-thing-hookup-guide/installing-the-esp32-arduino-core
They have provided all the steps (including the creation of folders/directories) for installation of the core through github repository. And now the error is fixed and it is working perfectly!