Yacubane / esp32-arduino-matter

Matter IoT protocol library for ESP32 working on Arduino framework
Apache License 2.0
322 stars 33 forks source link

Default examples not working #42

Open zhekch opened 1 year ago

zhekch commented 1 year ago

When attempting to run the default examples, they all fail to compile. I get this error with the light example. (this is only the last part of the error, as it is too big so i didnt paste it here)

/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h: In instantiation of 'nullable<T>::nullable(T) [with T = unsigned char]':
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_feature.h:100:88:   required from here
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h:184:62: error: 'IsNullValue' is not a member of 'chip::app::NumericAttributeTraits<unsigned char, false>'
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h: In instantiation of 'nullable<T>::nullable(T) [with T = short int]':
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_cluster.h:385:106:   required from here
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h:184:62: error: 'IsNullValue' is not a member of 'chip::app::NumericAttributeTraits<short int, false>'
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h: In instantiation of 'void nullable<T>::operator=(T) [with T = unsigned char]':
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/examples/Light/Light.ino:73:50:   required from here
/Users/zhekch/Documents/Arduino/libraries/ESP32_Arduino_Matter/src/esp_matter_attribute_utils.h:218:62: error: 'IsNullValue' is not a member of 'chip::app::NumericAttributeTraits<unsigned char, false>'
         if (chip::app::NumericAttributeTraits<T>::IsNullValue(value)) {
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~

exit status 1

Compilation error: exit status 1
Yacubane commented 1 year ago

Can you send full config? Which board is selected in Arduino IDE? Did you enable C++17 for Arduino IDE? What version of ESP32 boards are you using?

zhekch commented 1 year ago

Here is my board config:

Screenshot 2023-09-24 at 10 28 36

I believe enabling c++ is a windows feature, while im on mac, and what exactly do you mean by a version of a board?

WillemJoosten commented 1 year ago

Managed to get it to compile: you MUST use the C++17 modification as mentioned in the readme. I also struggled to get it to compile on my Mac (Ventura 13.6) but C++ is not a windows-only feature :)

Yacubane commented 11 months ago

@zhekch did you manage to solve this issue? As @WillemJoosten said, C++ is not a windows-only feature 😊

Martenz commented 3 months ago

Got this error on my Mac Book Pro with platformio: 'OnOff' has not been declared

I added to the platform.ini as described in the readme:

build_unflags=-std=gnu++11 build_flags =

It won't recognize these classes

plus other names.

Thanks