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

Bug: Namespace clash in v0.7.0 #134

Open
sseeberger96 opened this issue Mar 21, 2024 · 0 comments
Open

Bug: Namespace clash in v0.7.0 #134

sseeberger96 opened this issue Mar 21, 2024 · 0 comments

Comments

@sseeberger96
Copy link

Hi! I recently upgraded a project of mine from v0.4.8 to v0.7.0 of this library and it broke my build. My compiler was complaining that a reference to 'Slave' is ambiguous , since another library I'm using also defines a Slave object. At first glance this error was odd to me, since the Dynamixel2Arduino slave class is nicely defined in its own namespace to avoid name clashes.

However, after digging a little deeper, I was able to isolate the problem to a specific update made in v0.7.0 (v0.6.3 does not cause me any issues). It looks like a using namespace DYNAMIXEL line was added to the protocol.h file here. Since this protocol.h file is included by utility/master.h which is included by Dynamixel2Arduino.h, any file that includes the Dynamixel2Arduino.h header is silently configured to use the DYNAMIXEL namespace.

This doesn't seem like intended behavior, since always using a namespace upon including a header basically defeats the purpose of having a namespace to begin with. So I'm hoping it's possible to make a patch here that removes the using namespace DYNAMIXEL line in protocol.h and just explicitly references the DYNAMIXEL namespace in the areas of protocol.h and protocol.cpp where it is needed.

Thanks!

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

1 participant