Getting error: "reference to 'byte' is ambiguous" with Arduino IDE1.8.15
bill-orange opened this issue · 11 comments
Since updating to Arduino IDE1.8.15, I am getting the compiler error:'
error: reference to 'byte' is ambiguous
bool summertime (int year, byte month, byte day, byte hour, byte weekday, byte tzHours);
when using this library. It appears that there is some change in the use of the type byte.
I re-tested with NTPClientBasic and confirmed the problem.
Is there a work-around?
**EDIT:
I discovered that the problem was not with the IDE but was with the compiler/board manager. I reverted to esp8266 ver 2.7.4 from 3.0.0 and all was well.
Hardly a permanent solution. I am not sure if this is a bug or a feature.
I have the same concern
I have not yet found where it comes from
i have errors from arduino.h regarding byte
I looks like the developers broke a lot of things with 3.0.0 although I don't see byte
on the list.
you can test this : stef-ladefense@ed22ce9
and have change in C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\Arduino.h
line 247
uint16_t makeWord(byte h, byte l);
to
uint16_t makeWord(uint8_t h, uint8_t l);
and have change in C:\Users\xxxxx\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.0\cores\esp8266\Arduino.h
line 247
uint16_t makeWord(byte h, byte l);
to
uint16_t makeWord(uint8_t h, uint8_t l);
Yes, that fork works fine in both version 2.7.4 and version 3.0.0 even without changing Arduino.h.
ESP8266Ping.h is also broken. I think it will need the change to Arduino.h to make it work plus getting rid of byte,
indeed as I note in the post for arduino.h, I use in my code word (h, l) and necessarily I corrected all the errors to compile my code, which included both NtpClient and arduino.h , moreover this is not the only core 3.0.0 file impacted with 'bytes', it will be necessary to learn how to replace by uint8_t
I'm glad it can help
Thanks for the help. I think we can close this issue even though this is likely to be an ongoing problem.
Use of byte
type was inherited from first tests when I started developing an NTP library. It makes sense to use a standard type like uint8_t
I'm not criticizing, I also have some 'byte' leftovers in my sources, and with the new changes we'll have to be more rigorous and that's a good thing
merci