crankyoldgit / IRremoteESP8266

Infrared remote library for ESP8266/ESP32: send and receive infrared signals with multiple protocols. Based on: https://github.com/shirriff/Arduino-IRremote/
GNU Lesser General Public License v2.1
2.95k stars 831 forks source link

Error when compiling IRMQTTServer code #1997

Closed Jadyla closed 1 year ago

Jadyla commented 1 year ago

Version/revision of the library used

2.8.5 version

Describe the bug

I was working on a previous version (2.8.1) in a currently project, and was working fine. When I updated to 2.8.5 version and run IRMQTTServer example code I got some errors when compiling. I didn't made any change to the code.

I'm new working with arduino/embedded, am I missing something? I search for this error but nothing that I found was related to libraries or dependencies versions.

To Reproduce

I use ESP32 and was trying to upload the code, with no changes. When I press the button "Verify" on Arduino IDE to compile I got the message error.

Expected behaviour

Compile and upload the code to my ESP32.

I have followed the steps in the Troubleshooting Guide & read the FAQ

Yes.

Has this library/code previously worked as expected for you?

Yes, in 2.8.1 version.

Other useful information

Compiling Error:

/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1014:62: error: 'ac_command_t' in namespace 'stdAc' does not name a type
 String htmlSelectCommandType(const String name, const stdAc::ac_command_t def) {
                                                              ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1014:62: error: 'ac_command_t' in namespace 'stdAc' does not name a type
 String htmlSelectCommandType(const String name, const stdAc::ac_command_t def) {
                                                              ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino: In function 'String htmlSelectCommandType(String, int)':
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1017:28: error: 'stdAc::ac_command_t' has not been declared
        i <= (int8_t)stdAc::ac_command_t::kLastAcCommandEnum;
                            ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1019:25: error: 'commandTypeToString' is not a member of 'IRac'
     String mode = IRac::commandTypeToString((stdAc::ac_command_t)i);
                         ^~~~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1019:53: error: 'ac_command_t' is not a member of 'stdAc'
     String mode = IRac::commandTypeToString((stdAc::ac_command_t)i);
                                                     ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1020:48: error: 'ac_command_t' is not a member of 'stdAc'
     html += htmlOptionItem(mode, mode, (stdAc::ac_command_t)i == def);
                                                ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino: In function 'void handleAirCon()':
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1154:46: error: 'struct stdAc::state_t' has no member named 'sensorTemperature'
     bool noSensorTemp = (climate[chan]->next.sensorTemperature == kNoTempValue);
                                              ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1154:67: error: 'kNoTempValue' was not declared in this scope
     bool noSensorTemp = (climate[chan]->next.sensorTemperature == kNoTempValue);
                                                                   ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1154:67: note: suggested alternative: 'kNoRepeat'
     bool noSensorTemp = (climate[chan]->next.sensorTemperature == kNoTempValue);
                                                                   ^~~~~~~~~~~~
                                                                   kNoRepeat
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1169:68: error: 'struct stdAc::state_t' has no member named 'command'
             htmlSelectCommandType(KEY_COMMAND, climate[chan]->next.command) +
                                                                    ^~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1193:56: error: 'struct stdAc::state_t' has no member named 'sensorTemperature'
                             String(climate[chan]->next.sensorTemperature, 1)) +
                                                        ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:1212:59: error: 'struct stdAc::state_t' has no member named 'iFeel'
             htmlSelectBool(KEY_IFEEL, climate[chan]->next.iFeel) +
                                                           ^~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino: In function 'void updateClimate(stdAc::state_t*, String, String, String)':
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3255:12: error: 'struct stdAc::state_t' has no member named 'command'
     state->command = IRac::strToCommandType(payload.c_str());
            ^~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3255:28: error: 'strToCommandType' is not a member of 'IRac'
     state->command = IRac::strToCommandType(payload.c_str());
                            ^~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3275:12: error: 'struct stdAc::state_t' has no member named 'sensorTemperature'
     state->sensorTemperature = payload.toFloat();
            ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3282:14: error: 'struct stdAc::state_t' has no member named 'sensorTemperature'
       state->sensorTemperature = kNoTempValue;
              ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3282:34: error: 'kNoTempValue' was not declared in this scope
       state->sensorTemperature = kNoTempValue;
                                  ^~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3282:34: note: suggested alternative: 'kNoRepeat'
       state->sensorTemperature = kNoTempValue;
                                  ^~~~~~~~~~~~
                                  kNoRepeat
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3291:12: error: 'struct stdAc::state_t' has no member named 'iFeel'
     state->iFeel = IRac::strToBool(payload.c_str());
            ^~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino: In function 'bool sendClimate(String, bool, bool, bool, bool, IRac*)':
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3329:12: error: 'const struct stdAc::state_t' has no member named 'command'
   if (prev.command != next.command || forceMQTT) {
            ^~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3329:28: error: 'const struct stdAc::state_t' has no member named 'command'
   if (prev.command != next.command || forceMQTT) {
                            ^~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3330:32: error: 'commandTypeToString' is not a member of 'IRac'
     String command_str = IRac::commandTypeToString(next.command);
                                ^~~~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3330:57: error: 'const struct stdAc::state_t' has no member named 'command'
     String command_str = IRac::commandTypeToString(next.command);
                                                         ^~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3367:12: error: 'const struct stdAc::state_t' has no member named 'sensorTemperature'
   if (prev.sensorTemperature != next.sensorTemperature || forceMQTT) {
            ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3367:38: error: 'const struct stdAc::state_t' has no member named 'sensorTemperature'
   if (prev.sensorTemperature != next.sensorTemperature || forceMQTT) {
                                      ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3370:31: error: 'const struct stdAc::state_t' has no member named 'sensorTemperature'
                          next.sensorTemperature, retain);
                               ^~~~~~~~~~~~~~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3387:12: error: 'const struct stdAc::state_t' has no member named 'iFeel'
   if (prev.iFeel != next.iFeel || forceMQTT) {
            ^~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3387:26: error: 'const struct stdAc::state_t' has no member named 'iFeel'
   if (prev.iFeel != next.iFeel || forceMQTT) {
                          ^~~~~
/home/jady/Documents/teste/IRremoteESP8266/examples/IRMQTTServer/IRMQTTServer.ino:3389:56: error: 'const struct stdAc::state_t' has no member named 'iFeel'
     success &= sendBool(topic_prefix + KEY_IFEEL, next.iFeel, retain);
                                                        ^~~~~

exit status 1

Compilation error: 'ac_command_t' in namespace 'stdAc' does not name a type
NiKiZe commented 1 year ago

Closing as duplicate of #1987 Make sure your example matches library and that not the wron library version is pulled in.

Jadyla commented 1 year ago

My mistake, I didn't see this closed issue. It worked, thanks for your help :)

Closing as duplicate of #1987 Make sure your example matches library and that not the wron library version is pulled in.