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] multiple definition of visionary::VisionaryControl::kSessionTimeout #1

Open
arrfou99 opened this issue Aug 22, 2024 · 2 comments

Comments

@arrfou99
Copy link

I get a multiple definition error that I never got before which is not clear to me why!

After checking it looks like there are two kSessionTimeout defined where we have this constant defined two times:

constexpr std::chrono::seconds VisionaryControl::kSessionTimeout;

static constexpr std::chrono::seconds kSessionTimeout = std::chrono::seconds(5);

in order to avoid this error I had to remove the line VisionaryControl.cpp and use this in the VisionaryControl.h

 static constexpr std::chrono::seconds kSessionTimeout = std::chrono::seconds(5);
@peichtoSICKAG
Copy link
Collaborator

Hi arrfou99,

during our current release process, we noticed this issue again.
according to c++ spec a static constexpr data member which could be accessed via its memory address during runtime needs this additional declaration. Thus we did not change anything within the 1.1.0 release.
In our build matrix MSVC2022 compiler version 19.x, mingw x64 gcc 14.2 and linux native gcc 11.4 we did not face any problems.
If I remember correctly however, there were severeal changes regarding constexpr behaviour between different c++ standard versions.
Thus if you would like to add a combination of compiler / c++ standard where this is a problem we could consider making this conditional for the next release.
Otherwise we'd like to close this issue.

Sincerely
peichtoSICKAG

@robclaes
Copy link

I'm having the same issue while integrating this into ROS2 (humble) on default Ubuntu 22 ROS Docker container. In an Ubuntu24 ROS2 (Jazzy) this does not cause an error. Both of them are using the ROS2 colcon build environment.

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