Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlatformIO build failed. v.2.3.1 #48

Closed
Gizmodo opened this issue Aug 12, 2019 · 6 comments
Closed

PlatformIO build failed. v.2.3.1 #48

Gizmodo opened this issue Aug 12, 2019 · 6 comments
Labels
bug Something isn't working

Comments

@Gizmodo
Copy link
Contributor

Gizmodo commented Aug 12, 2019

Describe the bug

C:\Users\user.platformio\lib\Firebase ESP8266 Client_ID6247\src\FirebaseESP8266.cpp: In member function 'void FirebaseESP8266::setClock()':
C:\Users\user.platformio\lib\Firebase ESP8266 Client_ID6247\src\FirebaseESP8266.cpp:4885:30: error: 'time' was not declared in this scope
time_t now = time(nullptr);
^
C:\Users\user.platformio\lib\Firebase ESP8266 Client_ID6247\src\FirebaseESP8266.cpp:4899:15: error: aggregate 'tm timeinfo' has incomplete type and cannot be defined
struct tm timeinfo;
^
C:\Users\user.platformio\lib\Firebase ESP8266 Client_ID6247\src\FirebaseESP8266.cpp:4900:29: error: 'gmtime_r' was not declared in this scope
gmtime_r(&now, &timeinfo);
^
*** [.pio\build\esp12e\lib573\Firebase ESP8266 Client_ID6247\FirebaseESP8266.cpp.o] Error 1

To Reproduce
Steps to reproduce the behavior:

  1. Build any example

Expected behavior
Successful build

IDE and its version:

  • PlatformIO
  • Version 2.2.0

ESP8266 Arduino Core SDK version

  • Version 2.5.1

Additional context
If I downgrade to 2.3.0 - no build errors.

@Gizmodo Gizmodo added bug Something isn't working good first issue labels Aug 12, 2019
@mobizt
Copy link
Owner

mobizt commented Aug 12, 2019

I fixed for missing time.h header file. Please update the library.

@Gizmodo
Copy link
Contributor Author

Gizmodo commented Aug 12, 2019

PlatformIO still see old version 2.3.1 (issue platformio/platformio-api#23).
I tried to apply your commit manually, but the error still here.

@mobizt
Copy link
Owner

mobizt commented Aug 12, 2019

Actually time.h is in the core library. Any third party libraries contained time.h?

Check and search third party lib for time.h, temporary remove it or update platformio again.

@mobizt
Copy link
Owner

mobizt commented Aug 12, 2019

The code that you've got the error is just for get NTP server time.
This required for BearSSL/axTLS SSL/TLS handshake process.
If you can't run the below code, the problem may come from time.h include file conflicts.

    configTime(3 * 3600, 0, "pool.ntp.org", "time.nist.gov");
    time_t now = time(nullptr);
    while (now < 8 * 3600 * 2)
    {
        delay(100);
        now = time(nullptr);
    }

    struct tm timeinfo;
    gmtime_r(&now, &timeinfo);

This issue caused by duplicate time.h from other libraries. Please read this and this.

@Gizmodo
Copy link
Contributor Author

Gizmodo commented Aug 12, 2019

Thank you. The problem was with https://github.com/PaulStoffregen/Time library. It has Time.h.
I renamed it to TimeLib.h and build succeessfuly.
P.S. Arduino IDE does not have this problem with 2.3.1.

@mobizt
Copy link
Owner

mobizt commented Aug 12, 2019

I also don't understand why well known dev don't care about naming.

@mobizt mobizt closed this as completed Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants