Downloading and installing the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By awildthorp
#90601 Hello,

I'm running through setting up my WeMos D1 Mini with PlatformIO and I was following the getting started guide [1]. However after installing the esp8266 framework with `pio platform add espressif8266`, when I try and run `pio run` I get a compile error [2]. As a sanity check I installed the board in the Arduino IDE and was able to run my code. This makes me think I may need additional dependencies for platformio to run. Does anyone have any experience with this?

Thanks,

awildthorp

[1] https://arduino-esp8266.readthedocs.io/ ... uick-start
[2] https://pastebin.com/AjvmifM3

Update: The line in the log `unknown type name 'class'` stood out to me in the log. I believe for some reason the library is being compiled as C and not C++. I ran `pio run -v` to see if I could find the GCC command and this appears to be the compile command:
```xtensa-lx106-elf-gcc -o .pio/build/d1_mini/src/main.c.o -c -std=gnu99 -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -Os -mlongcalls -mtext-section-literals -falign-functions=4 -U__STRICT_ANSI__ -ffunction-sections -fdata-sections -fno-exceptions -Wall -DPLATFORMIO=50100 -DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_WEMOS_D1MINI -DF_CPU=80000000L -D__ets__ -DICACHE_FLASH -DARDUINO=10805 -DARDUINO_BOARD=\"PLATFORMIO_D1_MINI\" -DFLASHMODE_DIO -DLWIP_OPEN_SRC -DNONOSDK22x_190703=1 -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -DVTABLES_IN_FLASH -Iinclude -Isrc -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi/src -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/tools/sdk/include -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/tools/sdk/libc/xtensa-lx106-elf/include -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/cores/esp8266 -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip2/include -I/home/andrew/.platformio/packages/framework-arduinoespressif8266/variants/d1_mini src/main.c
```