jspark311 / Arduino-ADG2128

A library for the ADG2128 analog cross-point switch.
https://hackaday.io/project/167228-adg2128-breakout
Other
1 stars 0 forks source link

Arduino R4 compilation error: 'uint' has not been declared #3

Closed gluon closed 2 months ago

gluon commented 6 months ago

Hi there, We are trying to compile some piece of code using your library and we got this error :

/CppPotpourri/src/StringBuilder.h:118:17 error: 'uint' has not been declared

Our arduino is R4 Wifi.

Would you have a workaround ?

Thanks a lot.

jspark311 commented 2 months ago

My apologies for the late reply. Some parts of C3P used uint until last year. Which is a vestige from before portability was a concern. Practically, most platforms didn't experience this portability problem if they were using GCC prior to version 10. https://stackoverflow.com/questions/5678049/difference-between-uint-and-unsigned-int

You can work around by adding a typedef to unsigned int. But my use of uint was wrong to begin with. I'm not certain when you pulled your copy of C3P, but I would strongly recommend re-pulling StringBuilder, at least. It has seen massive efficiency and reliability gains in the past year. And the latest version doesn't use uint in the first place. The changes should be API non-breaking. So you could opt to only take StringBuilder.

gluon commented 2 months ago

Actually, and I apologize for not having updated it, this is what we did and it worked and still works fine. Thanks a lot.