PaulStoffregen / Time

Time library for Arduino
http://playground.arduino.cc/code/time
1.25k stars 666 forks source link

Azure IOT Hub fails to compile when including TimeLib.h #92

Open photomoose opened 6 years ago

photomoose commented 6 years ago

I can't seem to get the Azure IOT Hub libraries to compile when I include TimeLib.h.

#include <AzureIoTHub.h>
#include <AzureIoTProtocol_MQTT.h>
#include <TimeLib.h>

void setup() {
}

void loop() {
}

The above sketch outputs the following compilation error:

In file included from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/agenttypesystem.h:9:0,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/schema.h:9,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/iotdevice.h:9,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:52,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:9,

                 from C:\Users\Tom\Documents\Arduino\test\test.ino:1:

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:62:11: error: '::tm' has not been declared

   using ::tm;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:64:11: error: '::clock' has not been declared

   using ::clock;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:65:11: error: '::difftime' has not been declared

   using ::difftime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:66:11: error: '::mktime' has not been declared

   using ::mktime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:67:11: error: '::time' has not been declared

   using ::time;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:68:11: error: '::asctime' has not been declared

   using ::asctime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:69:11: error: '::ctime' has not been declared

   using ::ctime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:70:11: error: '::gmtime' has not been declared

   using ::gmtime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:71:11: error: '::localtime' has not been declared

   using ::localtime;

           ^

c:\users\tom\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1\arm-none-eabi\include\c++\4.8.3\ctime:72:11: error: '::strftime' has not been declared

   using ::strftime;

           ^

In file included from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/schema.h:9:0,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/iotdevice.h:9,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/serializer.h:52,

                 from C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/AzureIoTHub.h:9,

                 from C:\Users\Tom\Documents\Arduino\test\test.ino:1:

C:\Users\Tom\Documents\Arduino\libraries\AzureIoTHub\src/sdk/agenttypesystem.h:138:15: error: field 'dateTime' has incomplete type

     struct tm dateTime;

Any help would be greatly appreciated.

dpeddi commented 6 years ago

on windows system Time.h override time.h

I have tried to ask the maintainer to rename on #67 it but he won't agree