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

opengp::glfwTrackball Potential ODR Violation #7

Closed
RobertLeahy opened this issue Oct 28, 2015 · 1 comment
Closed

opengp::glfwTrackball Potential ODR Violation #7

RobertLeahy opened this issue Oct 28, 2015 · 1 comment

Comments

@RobertLeahy
Copy link
Contributor

The function opengp::glfwTrackball is declared in external/OpenGP/GL/glfw_trackball.h file, however it is not marked inline and therefore has external linkage (functions have external linkage by default).
As it is in a header it may be included in multiple translation units. The compiler will dutifully emit its code into each resulting object file, which will then cause a linker error.
To rectify this opengp::glfwTrackball should be marked inline. This will give it internal linkage and cause the linker to cull any duplicates found.

@taiya
Copy link
Owner

taiya commented Oct 28, 2015

Can you send in a pull request?

@taiya taiya closed this as completed Oct 29, 2015
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

2 participants