geerlingguy / airgradient-prometheus

AirGradient Prometheus exporter.
MIT License
176 stars 59 forks source link

error while compiling. no matching function for call to 'AirGradient::AirGradient()' #46

Open richiepleaserich opened 2 months ago

richiepleaserich commented 2 months ago

AirGradient-DIY.ino:72:30: error: no matching function for call to 'AirGradient::AirGradient()' 72 | AirGradient ag = AirGradient(); | ^ In file included from G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:6: \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:27:3: note: candidate: 'AirGradient::AirGradient(BoardType)' 27 | AirGradient(BoardType type); | ^~~ \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:27:3: note: candidate expects 1 argument, 0 provided \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:25:7: note: candidate: 'constexpr AirGradient::AirGradient(const AirGradient&)' 25 | class AirGradient { | ^~~ \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:25:7: note: candidate expects 1 argument, 0 provided \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:25:7: note: candidate: 'constexpr AirGradient::AirGradient(AirGradient&&)' \richserver\d\backup\rich\Documents\Arduino\libraries\AirGradient_Air_Quality_Sensor\src/AirGradient.h:25:7: note: candidate expects 1 argument, 0 provided G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:75:1: error: 'TMP_RH' does not name a type 75 | TMP_RH value_sht; | ^~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino: In function 'void setup()': G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:116:6: error: 'class AirGradient' has no member named 'PMS_Init' 116 | ag.PMS_Init(); | ^~~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:119:6: error: 'class AirGradient' has no member named 'CO2_Init' 119 | ag.CO2_Init(); | ^~~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:122:6: error: 'class AirGradient' has no member named 'TMP_RH_Init' 122 | ag.TMP_RH_Init(0x44); | ^~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino: In function 'uint8_t update()': G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:222:20: error: 'class AirGradient' has no member named 'getPM2_Raw' 222 | int value = ag.getPM2_Raw(); | ^~~~~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:236:20: error: 'class AirGradient' has no member named 'getCO2_Raw' 236 | int value = ag.getCO2_Raw(); | ^~~~~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:250:5: error: 'TMP_RH' was not declared in this scope 250 | TMP_RH value = ag.periodicFetchData(); | ^~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:251:9: error: 'value' was not declared in this scope 251 | if (value.t != NULL && value.rh != NULL) { | ^~~~~ G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:252:7: error: 'value_sht' was not declared in this scope; did you mean 'value_nox'? 252 | value_sht = value; | ^~~~~ | value_nox G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:281:48: error: 'value_sht' was not declared in this scope; did you mean 'value_nox'? 281 | compensationT = static_cast((value_sht.t + 45) 65535 / 175); | ^~~~~ | value_nox G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino: In function 'String GenerateMetrics()': G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:353:23: error: 'value_sht' was not declared in this scope; did you mean 'value_nox'? 353 | message += String(value_sht.t); | ^~~~~ | value_nox G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino: In function 'void updateOLED()': G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:416:26: error: 'value_sht' was not declared in this scope; did you mean 'value_nox'? 416 | ln3 = "F:" + String((value_sht.t 9 / 5) + 32) + " H:" + String(value_sht.rh) + "%"; | ^~~~~ | value_nox G:\projects\airgraident\AirGradient-DIY\AirGradient-DIY.ino:418:25: error: 'value_sht' was not declared in this scope; did you mean 'value_nox'? 418 | ln3 = "C:" + String(value_sht.t) + " H:" + String(value_sht.rh) + "%"; | ^~~~~ | value_nox

exit status 1

Compilation error: no matching function for call to 'AirGradient::AirGradient()'

zajac-dawid-dev commented 1 week ago

Hi :) Try to use older version 2.x. In my case it resolved that issue. image