hirotakaster / MQTT

MQTT for Photon, Spark Core
Other
216 stars 118 forks source link

Build fails because of missing application.h #58

Closed alignan closed 7 years ago

alignan commented 7 years ago

Hello! After removing #include "application.h" from MQTT.cpp, the application fails to compile:

In member function 'bool MQTT::connect(const char*, const char*, const char*, const char*, MQTT::EMQTT_QOS, uint8_t, const char*)':
MQTT/MQTT.cpp:156:55: error: 'millis' was not declared in this scope
             lastInActivity = lastOutActivity = millis();
                                                       ^
In member function 'bool MQTT::loop()':
MQTT/MQTT.cpp:237:34: error: 'millis' was not declared in this scope
         unsigned long t = millis();
                                  ^
In member function 'bool MQTT::write(uint8_t, uint8_t*, uint16_t)':
MQTT/MQTT.cpp:419:30: error: 'millis' was not declared in this scope
     lastOutActivity = millis();
                              ^
In member function 'void MQTT::disconnect()':
MQTT/MQTT.cpp:467:47: error: 'millis' was not declared in this scope
     lastInActivity = lastOutActivity = millis();

This is a known topic, as Particle build requires application.h. Including the header fix the problem

hirotakaster commented 7 years ago

Hi @alignan, application.h is already included "MQTT.h" in latest version, did not be included in MQTT.cpp now.

alignan commented 7 years ago

I don't see the include in the master branch

hirotakaster commented 7 years ago

https://github.com/hirotakaster/MQTT/blob/master/firmware/MQTT.h

hirotakaster commented 7 years ago

@alignan Okay, Now I checked on Particle WebIDE and local IDE, in that's environment everything okay. Maybe I forget the update to the github.

hirotakaster commented 7 years ago

now fixed header.