rlogiacco / CircularBuffer

Arduino circular buffer library
GNU Lesser General Public License v3.0
312 stars 85 forks source link

Namespace conflict with internal Arduino CircularBuffer #72

Closed ubidefeo closed 10 months ago

ubidefeo commented 1 year ago

While trying to compile a Sketch downloaded from Barilla, I found that I could not compile it since it required <RCircularBuffer.h> which was nowhere to be found. The error of a missing index_t type prompted me to do some research and found your library.

To make it work I had to rename the Class and finally got the sketch to compile.

Is there any chance to implement a namespace?

The Sketch which breaks is the following https://github.com/twofingerrightclick/BarillaPassiveCookingDevice/blob/main/Arduino/sketch_PastaThermometer_nano/sketch_PastaThermometer_nano.ino

The developer very likely did exactly what I did to make it work, rename Class and its occurrences in templates

rlogiacco commented 11 months ago

As reported qin the issue you are referencing, the correct solution is to use a specific reference to the library.

The sketch you are referencing should be changed so that no class gets renamed: if the author did, he/she should have included the renamed class.

With regards to namespaces, I don't see namespaces being used in the microcontroller world... can you give me examples of libraries using namespaces widely adopted in the microcontroller domain, and thus change my percpeption?

Thanks a million!

rlogiacco commented 11 months ago

In addition there's a potential fix in a dedicated branch fix/library-include which I was waiting for validation: can you please verify if that's of any help?

github-actions[bot] commented 10 months ago

This issue is being marked as stale as it has not been updated in the past 15 days and it will be closed in a week unless it receives the requested attention.

github-actions[bot] commented 10 months ago

Issue is being closed due to lack of interaction