I am trying to compile this sketch with Platformio in VSCode: https://github.com/scanlime/esp8266-Arduino/blob/master/tests/Time/Time.ino
It works without a problem in the Arduino IDE but in Platformio I get the following error message:
src\main.cpp: In function 'void setup()': src\main.cpp:27:23: error: 'time' was not declared in this scope while (!time(nullptr)) ^ src\main.cpp: In function 'void loop()': src\main.cpp:37:28: error: 'time' was not declared in this scope time_t now = time(nullptr); ^ src\main.cpp:38:28: error: 'ctime' was not declared in this scope Serial.println(ctime(&now)); Archiving .pio\build\d1_mini\libfd7\libTime_ID44.a ^ *** [.pio\build\d1_mini\src\main.cpp.o] Error 1
It seems to refer to the time.h in ‘.platformio\packages\framework-arduinoespressif8266\tools\sdk\lwip\include\lwip\app’. If I add this path to my include path like this
include_dir = C:/Users/klaraWasser/.platformio/packages/framework-arduinoespressif8266/tools/sdk/lwip/include/lwip/app
it won’t work either. However in the Arduino IDE it works without a problem. I have encountered such problems a lot with Platformio. I have been using Deviot with Sublime Text before and it also caused way less problems than Plaformio with VSCode.
Hopefully someone can help me with this one!