esp-matter icon indicating copy to clipboard operation
esp-matter copied to clipboard

Adding some Air Quality cluster features results in linker errors (CON-1618)

Open olavt opened this issue 11 months ago • 1 comments

Environment

  • ESP-Matter Commit Id: f9f62dd6851d93dd9c770f0ed0066e822f955c35
  • ESP-IDF Commit Id: c9763f62dd00c887a1a8fafe388db868a7e44069
  • SoC (eg: ESP32 or ESP32-C3): ESP32-C6

This works fine:

cluster::air_quality::feature::fair::add(cluster);

When I try to add these features, I get a linker errors:

cluster::air_quality::feature::mod::add(cluster);
cluster::air_quality::feature::vpoor::add(cluster);
cluster::air_quality::feature::xpoor::add(cluster);

/Users/olavt/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: esp-idf/main/libmain.a(app_main.cpp.obj): in function AddAirQualityClusterFeatures(unsigned int*)': /Users/olavt/Source/Repos/light/main/app_main.cpp:376:(.text._Z28AddAirQualityClusterFeaturesPj+0x16): undefined reference to esp_matter::cluster::air_quality::feature::mod::add(unsigned int*)' /Users/olavt/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /Users/olavt/Source/Repos/light/main/app_main.cpp:377:(.text._Z28AddAirQualityClusterFeaturesPj+0x20): undefined reference to esp_matter::cluster::air_quality::feature::vpoor::add(unsigned int*)' /Users/olavt/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin/../lib/gcc/riscv32-esp-elf/13.2.0/../../../../riscv32-esp-elf/bin/ld: /Users/olavt/Source/Repos/light/main/app_main.cpp:379:(.text._Z28AddAirQualityClusterFeaturesPj+0x30): undefined reference to esp_matter::cluster::air_quality::feature::xpoor::add(unsigned int*)' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.

olavt avatar Mar 28 '25 15:03 olavt

I think we have a issue about the api name, you can fix it manually, we will fix it later. https://github.com/espressif/esp-matter/blob/f9f62dd6851d93dd9c770f0ed0066e822f955c35/components/esp_matter/esp_matter_feature.cpp#L1030

https://github.com/espressif/esp-matter/blob/f9f62dd6851d93dd9c770f0ed0066e822f955c35/components/esp_matter/esp_matter_feature.h#L649

Jerry-ESP avatar Mar 31 '25 02:03 Jerry-ESP

@olavt , the change in available on the latest main branch now.

shripad621git avatar Apr 04 '25 08:04 shripad621git

Thanks, all these are working now:

cluster::air_quality::feature::fair::add(cluster);
cluster::air_quality::feature::moderate::add(cluster);
cluster::air_quality::feature::very_poor::add(cluster);
cluster::air_quality::feature::extremely_poor::add(cluster);

olavt avatar Apr 05 '25 14:04 olavt