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

Error while compiling with getTime() in GSM.cpp #120

Open
diddi68 opened this issue Aug 14, 2020 · 1 comment
Open

Error while compiling with getTime() in GSM.cpp #120

diddi68 opened this issue Aug 14, 2020 · 1 comment

Comments

@diddi68
Copy link

diddi68 commented Aug 14, 2020

I get following error messages while compiling my project:

`Arduino: 1.8.13 (Windows Store 1.8.42.0) (Windows 10), Board: "Arduino MKR GSM 1400"

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp: In member function 'long unsigned int GSM::getTime()':

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:339:13: error: aggregate 'GSM::getTime()::tm now' has incomplete type and cannot be defined

struct tm now;

         ^~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:341:7: error: 'strptime' was not declared in this scope

if (strptime(response.c_str(), "+CCLK: "%y/%m/%d,%H:%M:%S", &now) != NULL) {

   ^~~~~~~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:341:7: note: suggested alternative: 'strxfrm'

if (strptime(response.c_str(), "+CCLK: "%y/%m/%d,%H:%M:%S", &now) != NULL) {

   ^~~~~~~~

   strxfrm

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:344:21: error: 'mktime' was not declared in this scope

 time_t result = mktime(&now);

                 ^~~~~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:344:21: note: suggested alternative: 'getTime'

 time_t result = mktime(&now);

                 ^~~~~~

                 getTime

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp: In member function 'long unsigned int GSM::getLocalTime()':

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:368:13: error: aggregate 'GSM::getLocalTime()::tm now' has incomplete type and cannot be defined

struct tm now;

         ^~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:370:7: error: 'strptime' was not declared in this scope

if (strptime(response.c_str(), "+CCLK: "%y/%m/%d,%H:%M:%S", &now) != NULL) {

   ^~~~~~~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:370:7: note: suggested alternative: 'strxfrm'

if (strptime(response.c_str(), "+CCLK: "%y/%m/%d,%H:%M:%S", &now) != NULL) {

   ^~~~~~~~

   strxfrm

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:371:21: error: 'mktime' was not declared in this scope

 time_t result = mktime(&now);

                 ^~~~~~

D:\OneDrive\Arduino\libraries\MKRGSM\src\GSM.cpp:371:21: note: suggested alternative: 'getTime'

 time_t result = mktime(&now);

                 ^~~~~~

                 getTime

exit status 1`

@sparten9999
Copy link

im gettign the same error when i restart the ide if i have #include <TimeLib.h> inside the code. if i comment it out, recompile, uncomment it, and recompile again it will work. but i have to do this everytime i close the ide. and if i use any code that uses the timelib library i need to comment that out to so i get the first successful compile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants