0

Example adafruitio_00_publish error compile
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Example adafruitio_00_publish error compile

by RAMM on Tue Apr 23, 2019 2:06 pm

I tried to make the example adafruitio_00_publish but i stumbled upon an error while compiling.

so i followed the arduino IO library from this link https://learn.adafruit.com/adafruit-io-basics-esp8266-arduino/arduino-io-library
and i still get the compiling error for my esp8266.

Error message:
Code: Select all | TOGGLE FULL SIZE
Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Adafruit Feather HUZZAH ESP8266, 80 MHz, 4M (3M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp: In member function 'virtual bool Adafruit_MQTT_Client::sendPacket(uint8_t*, uint16_t)':

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: error: no matching function for call to 'min(uint16_t&, int)'

       uint16_t sendlen = min(len, 250);

                                      ^

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: note: candidates are:

In file included from c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:62:0,

                 from C:\Users\Justi\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Arduino.h:254,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT.h:25,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.h:26,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:22:

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4226:5: note: template<class _Tp, class _Compare> _Tp std::min(std::initializer_list<_Tp>, _Compare)

     min(initializer_list<_Tp> __l, _Compare __comp)

     ^

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4226:5: note:   template argument deduction/substitution failed:

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'

       uint16_t sendlen = min(len, 250);

                                      ^

In file included from c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:62:0,

                 from C:\Users\Justi\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Arduino.h:254,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT.h:25,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.h:26,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:22:

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4221:5: note: template<class _Tp> _Tp std::min(std::initializer_list<_Tp>)

     min(initializer_list<_Tp> __l)

     ^

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algo.h:4221:5: note:   template argument deduction/substitution failed:

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'short unsigned int'

       uint16_t sendlen = min(len, 250);

                                      ^

In file included from c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:61:0,

                 from C:\Users\Justi\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Arduino.h:254,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT.h:25,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.h:26,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:22:

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note: template<class _Tp, class _Compare> const _Tp& std::min(const _Tp&, const _Tp&, _Compare)

     min(const _Tp& __a, const _Tp& __b, _Compare __comp)

     ^

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:239:5: note:   template argument deduction/substitution failed:

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: note:   deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')

       uint16_t sendlen = min(len, 250);

                                      ^

In file included from c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\algorithm:61:0,

                 from C:\Users\Justi\Documents\ArduinoData\packages\esp8266\hardware\esp8266\2.4.1\cores\esp8266/Arduino.h:254,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT.h:25,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.h:26,

                 from C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:22:

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:193:5: note: template<class _Tp> const _Tp& std::min(const _Tp&, const _Tp&)

     min(const _Tp& __a, const _Tp& __b)

     ^

c:\users\justi\documents\arduinodata\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\bits\stl_algobase.h:193:5: note:   template argument deduction/substitution failed:

C:\Users\Justi\Documents\Arduino\libraries\Adafruit_MQTT_Library\Adafruit_MQTT_Client.cpp:84:38: note:   deduced conflicting types for parameter 'const _Tp' ('short unsigned int' and 'int')

       uint16_t sendlen = min(len, 250);

                                      ^

exit status 1
Error compiling for board Adafruit Feather HUZZAH ESP8266.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.


Why does it not compile?
Last edited by franklin97355 on Tue Apr 23, 2019 2:40 pm, edited 1 time in total.
Reason: Please use code tags when posting code or logs to the forums. It preserves formatting and makes it easier for everyone to read the code. Click the code button above the reply box and past your code between the tags created.

RAMM
 
Posts: 1
Joined: Mon Apr 22, 2019 3:17 pm

Re: Example adafruitio_00_publish error compile

by adafruit_support_carter on Tue Apr 23, 2019 4:53 pm

Check and make sure you have the latest versions of all the libraries. And try with version 2.4.2 of the ESP8266 BSP.

adafruit_support_carter
 
Posts: 12705
Joined: Tue Nov 29, 2016 2:45 pm

Re: Example adafruitio_00_publish error compile

by tweil on Tue Apr 30, 2019 4:53 pm

This exact same error occurs with ESP32. I had to downgrade the ESP32 in Board Manager to version 1.0.1.

tweil
 
Posts: 6
Joined: Thu May 02, 2013 12:53 pm

Please be positive and constructive with your questions and comments.