Closed cyba3r closed 6 years ago
Thanks for posting this - I am having the same problems with the Adafruit HUZZAH ESP8266
Had this same problem and solved it for myself by using Arduino Board Manager to switch from esp8266 v2.4.0 to v2.3.0.
Original compilation error I was seeing:
Arduino: 1.8.5 (Mac OS X), Board: "Adafruit HUZZAH ESP8266, 80 MHz, 4M (3M SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 115200"
Build options changed, rebuilding all
/Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp: In member function 'virtual bool Adafruit_MQTT_Client::sendPacket(uint8_t*, uint16_t)':
/Users/sam/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);
^
/Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:84:38: note: candidates are:
In file included from /Users/sam/Library/Arduino15/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 /Users/sam/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/sam/Library/Arduino15/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)
^
/Users/sam/Library/Arduino15/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:
/Users/sam/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 /Users/sam/Library/Arduino15/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 /Users/sam/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/sam/Library/Arduino15/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)
^
/Users/sam/Library/Arduino15/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:
/Users/sam/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 /Users/sam/Library/Arduino15/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 /Users/sam/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/sam/Library/Arduino15/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)
^
/Users/sam/Library/Arduino15/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:
/Users/sam/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 /Users/sam/Library/Arduino15/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 /Users/sam/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/sam/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/sam/Library/Arduino15/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)
^
/Users/sam/Library/Arduino15/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:
/Users/sam/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 HUZZAH ESP8266.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
exciting! please try the latest version just committed, you'll need to install 'by hand' - see if something else breaks? (thanks @jerryneedell for the gracious and fast PR)
@ladyada from the comments in #398 https://github.com/esp8266/Arduino/issues/398 there may be a better fix, but I’m not sure I fully understand the suggestion. The fix in #107 seems to be working. Any thoughts on this?
no idea - but if there's a better fix please submit a PR and we'll merge it in!
I’m not sure how to implement the suggestion, but if/when I figure it out, I’ll submit a PR.
maybe @devyte can explain what needs to be done?
@ladyada - looking at the history for Adafruit_MQTT_Client.cpp it do es not look like the version with the cast (uint16_t) 250 ever got released. The error reports were for 0.17 which does not have the cast and should fail according to the "new" rules. I have not tried compiling it with the cast since I was working from the 0.17 release as well. I'll try it this evening and see if it works and clears up the mystery.
huh did you try compiling before the fix you committed? :)
No - embarrassingly, I did not notice that there had been a new commit since 0.17 - sorry. I tried a similar test in gcc on my mac and it does compile. I'll test it in the Arduino IDE later. If it does compile, do you want to revert or stick with my probably unnecessary, but functional change?
lol ok - that makes way more sense. nah, you can keep it for now
Yup - confirmed that the commit from Oct 20 2017 actually does compile - with the added cast. Too bad it never got released ;-) Lesson learned to check the commits against the release version before updating. Sorry for the confusion. I also installed v 0.18 and it compiles as well.
I think we can close this issue.
done! thanks :)
We are always here to help
On Jan 11, 2018 2:23 AM, "ladyada" notifications@github.com wrote:
done! thanks :)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_MQTT_Library/issues/106#issuecomment-356733324, or mute the thread https://github.com/notifications/unsubscribe-auth/Af3Chn6QWp-3Mw8XPQJUY7upqf7uI6fVks5tJSNegaJpZM4RVSiE .
After upgrading vom ESP Version 2.3 to 2.4 MQTT_Library (0.17.0) failed to build with following errors:
Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp: In member function 'virtual bool Adafruit_MQTT_Client::sendPacket(uint8_t*, uint16_t)': /Users/joerg/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); ^ /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:84:38: note: candidates are: In file included from /Users/joerg/Library/Arduino15/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 /Users/joerg/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22: /Users/joerg/Library/Arduino15/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) ^ /Users/joerg/Library/Arduino15/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: /Users/joerg/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 /Users/joerg/Library/Arduino15/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 /Users/joerg/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26, from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22: /Users/joerg/Library/Arduino15/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 _Tp std::min(std::initializer_list<_Tp>)
min(initializer_list<_Tp> l)
^
/Users/joerg/Library/Arduino15/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:
/Users/joerg/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 /Users/joerg/Library/Arduino15/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 /Users/joerg/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/joerg/Library/Arduino15/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)
^
/Users/joerg/Library/Arduino15/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:
/Users/joerg/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 /Users/joerg/Library/Arduino15/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 /Users/joerg/Library/Arduino15/packages/esp8266/hardware/esp8266/2.4.0/cores/esp8266/Arduino.h:240,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT.h:25,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.h:26,
from /Users/joerg/Documents/Arduino/libraries/Adafruit_MQTT_Library/Adafruit_MQTT_Client.cpp:22:
/Users/joerg/Library/Arduino15/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 const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& a, const _Tp& b)
^
/Users/joerg/Library/Arduino15/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:
/Users/joerg/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
Fehler beim Kompilieren für das Board Generic ESP8266 Module.