I am going back to modify an old ESP8266 project that worked about 2 years ago. Now I get this error in the main.cpp window.
#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (X:\Documents\PlatformIO\Projects\ESP8266_Seedlings\src\main.cpp).C/C++(1696)
cannot open source file "utility" (dependency of "Arduino.h")C/C++(1696)
The build also fails not finding
“include utility” which agrees with the error message in the main.cpp window.
Same error with the 210220-222338-arduino-blink project example.
I have been using Platformio for other projects so maybe some compiler path is messed up.
Other projects using the atmelsam platform include the same arduino.h but build without errors. It uses the windows-gcc-arm compiler instead of the windows-gcc-x64 compiler.
You should first try and update everything. In a CLI, do a pio platform update to update all platforms.
You shoul then build the project first, even if there are IntelliSense ‘errors’. PlatformIO is the buil system and may download stuff at a later point where the IntelliSense doesn’t see it yet.
If there is a compile error, post it. Otherwise the issue shoul have been resolve automatically.
I performed pio platform update . Only an unrelated platform was out of date.
The IntelliSense error message is the same
The build error is the same. Here the first compile error:
Processing esp12e (platform: espressif8266; board: nodemcuv2; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.6.3) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
- framework-arduinoespressif8266 3.20704.0 (2.7.4)
- tool-esptool 1.413.0 (4.13)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 44 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\esp12e\src\main.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\Crypto.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\Esp-frag.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\Esp-version.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\Esp.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\FS.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\FSnoop.cpp.o
Compiling .pio\build\esp12e\FrameworkArduino\FunctionalInterrupt.cpp.o
In file included from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:238:0,
from src\main.cpp:2:
c:\users\graham smith\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:30: fatal error: utility: No such file or directory
#include <utility> // UK-300.
^
compilation terminated.
In file included from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:238:0,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Crypto.h:29,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Crypto.cpp:26:
c:\users\graham smith\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:30: fatal error: utility: No such file or directory
#include <utility> // UK-300.
^
compilation terminated.
*** [.pio\build\esp12e\FrameworkArduino\Crypto.cpp.o] Error 1
*** [.pio\build\esp12e\src\main.cpp.o] Error 1
In file included from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\coredecls.h:32:0,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Esp-frag.cpp:23:
c:\users\graham smith\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\functional:48:28: fatal error: bits/c++config.h: No such file or directory
#include <bits/c++config.h>
^
compilation terminated.
*** [.pio\build\esp12e\FrameworkArduino\Esp-frag.cpp.o] Error 1
In file included from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:238:0,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Esp-version.cpp:21:
c:\users\graham smith\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:30: fatal error: utility: No such file or directory
#include <utility> // UK-300.
^
compilation terminated.
*** [.pio\build\esp12e\FrameworkArduino\Esp-version.cpp.o] Error 1
In file included from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266/Arduino.h:238:0,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Esp.h:24,
from C:\users\graham smith\.platformio\packages\framework-arduinoespressif8266\cores\esp8266\Esp.cpp:21:
c:\users\graham smith\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2\algorithm:60:30: fatal error: utility: No such file or directory
#include <utility> // UK-300.
^
compilation terminated.
No luck deleting .cache
I tried platform = espressif8266@1.5.0 in platformio.ini
That compiled OK but I got this error when linking:
Linking .pio\build\esp12e\firmware.elf
c:/users/graham smith/.platformio/packages/toolchain-xtensa@1.40802.0/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: .pio\build\esp12e\firmware.elf section `.iram.text' will not fit in region `iram1_0_seg'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\esp12e\firmware.elf] Error 1
The main.cpp is very small, so I don’t understand the “fit” error.
Seems to be a bug in the espressif826 platform. What version actually works now? Too bad because the ESP8266 boards are very common and cheap these days.
But you also deleted toolchain-xtensa yes? Or for safety, all toolchain-xtensa-* folders right?
If yes, please double check that the toolchain folder has the file utility at C:\Users\<user>\.platformio\packages\toolchain-xtensa\xtensa-lx106-elf\include\c++\4.8.2. (The folder name may also be toolchain-xtensa@1.40802.0)