plapointe6 / HAMqttDevice

A library that provides tools to simplify MQTT discovery implementation for Home Assistant to your device.
GNU General Public License v3.0
43 stars 15 forks source link

Error compiling library for Arduino Mega #1

Open astrosteve0 opened 3 years ago

astrosteve0 commented 3 years ago

I'm getting an error compiling the library for an Arduino Mega 2560.

Arduino\libraries\HAMqttDevice\src/HAMqttDevice.h:24:10: error: 'vector' in namespace 'std' does not name a template type std::vector _configVars; ^~ Arduino\libraries\HAMqttDevice\src/HAMqttDevice.h:31:10: error: 'vector' in namespace 'std' does not name a template type std::vector _attributes; ^~

plapointe6 commented 3 years ago

Unfortunatly, it seems that AVR boards like Arduino Uno, Arduino Mega, etc does not support the c++ std library. For now, I will add a note to the readme to exclude them from supported boards. I will probably modify the code to remove every std dependency from this lib for more compatibility.

If you do IOT things, I suggest you tu use an inexpensive WiFi board like an ESP8266 (ex: Wemos D1 Mini) instead of an Arduino Mega.

miroslavpetrov commented 2 years ago

I have come up with the same error with esp32-s2. Adding #include <vector>to HAMqttDevice.h fixes the issue.

MichaKersloot commented 2 years ago

I have come up with the same error with esp32-s2. Adding #include <vector>to HAMqttDevice.h fixes the issue.

same for Arduino NANO 33 IoT (samd)