How to fix an annoying build error for ESP8266 builds.
The following build error occurs when building ESP8266 Wifi enabled example programs in Sloeber IDE.
11:24:28 **** Build of configuration Release for project esp_eink_dashboard ****
"C:\\tools\\sloeber4.3.1\\arduinoPlugin\\tools\\make\\make" all
'Building file: ..\sloeber.ino.cpp'
'Starting C++ compile'
"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/lwip2/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include" "-IG:/Repos/sloeber-workspace/esp_eink_dashboard/Release/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -fexceptions -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="\"ESP8266_NODEMCU\"" -DESP8266 -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\variants\nodemcu" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WebServer\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266mDNS\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WiFi\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src" -MMD -MP -MF"sloeber.ino.cpp.d" -MT"sloeber.ino.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "..\sloeber.ino.cpp" -o "sloeber.ino.cpp.o"
'Finished building: ..\sloeber.ino.cpp'
' '
'Building file: C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\server_drv.cpp'
'Starting C++ compile'
"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/lwip2/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include" "-IG:/Repos/sloeber-workspace/esp_eink_dashboard/Release/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -fexceptions -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="\"ESP8266_NODEMCU\"" -DESP8266 -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\variants\nodemcu" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WebServer\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266mDNS\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WiFi\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src" -MMD -MP -MF"libraries\WiFi\src\utility\server_drv.cpp.d" -MT"libraries\WiFi\src\utility\server_drv.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\server_drv.cpp" -o "libraries\WiFi\src\utility\server_drv.cpp.o"
'Finished building: C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\server_drv.cpp'
' '
'Building file: C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\spi_drv.cpp'
'Starting C++ compile'
"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9/bin/xtensa-lx106-elf-g++" -D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/lwip2/include" "-IC:\tools\sloeber4.3.1\/arduinoPlugin/packages/esp8266/hardware/esp8266/2.5.0-beta2/tools/sdk/libc/xtensa-lx106-elf/include" "-IG:/Repos/sloeber-workspace/esp_eink_dashboard/Release/core" -c -Wall -Wextra -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections -fexceptions -DF_CPU=80000000L -DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DARDUINO=10802 -DARDUINO_ESP8266_NODEMCU -DARDUINO_ARCH_ESP8266 -DARDUINO_BOARD="\"ESP8266_NODEMCU\"" -DESP8266 -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\cores\esp8266" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\variants\nodemcu" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WebServer\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266mDNS\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\packages\esp8266\hardware\esp8266\2.5.0-beta2\libraries\ESP8266WiFi\src" -I"C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src" -MMD -MP -MF"libraries\WiFi\src\utility\spi_drv.cpp.d" -MT"libraries\WiFi\src\utility\spi_drv.cpp.o" -D__IN_ECLIPSE__=1 -x c++ "C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\spi_drv.cpp" -o "libraries\WiFi\src\utility\spi_drv.cpp.o"
C:\tools\sloeber4.3.1\arduinoPlugin\libraries\WiFi\1.2.7\src\utility\spi_drv.cpp:21:17: fatal error: SPI.h: No such file or directory
#include <SPI.h>
^
compilation terminated.
libraries\WiFi\src\utility\subdir.mk:31: recipe for target 'libraries\WiFi\src\utility\spi_drv.cpp.o' failed
make: *** [libraries\WiFi\src\utility\spi_drv.cpp.o] Error 1
11:24:32 Build Failed. 3 errors, 0 warnings. (took 3s.380ms)
The solution is to select the affected project and remove the Wifi
library. The following will pop up:
The IDE will continuously attempt to re-add this library (and it’s pretty good and quick at doing so). For this reason, you have to disable the “Automatically import libraries based on includes?” and “Automatically install missing libraries based on includes?” check boxes in Menu > Arduino > Preferences.
I had problems with mDNS
as well. The reason for these is that ESP8266 supplies its own version of these libraries.