Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error: "reference to 'byte' is ambiguous" with Arduino IDE1.8.15 #114

Closed
bill-orange opened this issue May 28, 2021 · 11 comments
Closed

Comments

@bill-orange
Copy link

bill-orange commented May 28, 2021

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.

@stef-ladefense
Copy link

I have the same concern
I have not yet found where it comes from
i have errors from arduino.h regarding byte

@bill-orange
Copy link
Author

bill-orange commented May 30, 2021

I looks like the developers broke a lot of things with 3.0.0 although I don't see byte on the list.

https://github.com/esp8266/Arduino/releases

@stef-ladefense
Copy link

stef-ladefense commented May 31, 2021

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);

@stef-ladefense
Copy link

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);

see esp8266/Arduino#8089

@bill-orange
Copy link
Author

bill-orange commented May 31, 2021

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,

@stef-ladefense
Copy link

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

@bill-orange
Copy link
Author

@stef-ladefense @gmag11

Thanks for the help. I think we can close this issue even though this is likely to be an ongoing problem.

@gmag11
Copy link
Owner

gmag11 commented May 31, 2021

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

@stef-ladefense
Copy link

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

@gmag11
Copy link
Owner

gmag11 commented Jul 26, 2021

Fixed in 9624225

@stef-ladefense
Copy link

merci

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants