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

Multiply defined functions at link time due to omission of inline #101

Open
csc14gg opened this issue Feb 4, 2025 · 6 comments
Open

Multiply defined functions at link time due to omission of inline #101

csc14gg opened this issue Feb 4, 2025 · 6 comments

Comments

@csc14gg
Copy link
Contributor

csc14gg commented Feb 4, 2025

The proposed fix:

inline_functions.patch

Mark all functions inline
1. Corrects multiply defined symbol linker errors when
including tiny_bvh.h in more than one CPP file.
2. Replace static inline with just inline for the
functions declared that way, since static has no
semantic meaning with inline also declared.

Would you like me to open a pull request for this? Thanks!

@jbikker
Copy link
Owner

jbikker commented Feb 4, 2025

Could it be that you included tinybvh with TINYBVH_IMPLEMENTATION defined in several files? You should include it with that define active only in one c/cpp.

@csc14gg
Copy link
Contributor Author

csc14gg commented Feb 4, 2025

No, the functions my patch changes are not in the implementation section guarded by TINYBVH_IMPLEMENTATION.

@jbikker
Copy link
Owner

jbikker commented Feb 4, 2025

Oh I see what's going on. I specifically setup an example to test inclusion in multiple files, but that test also overrides the math classes... I am going to apply your patch, thanks. :)

@jbikker
Copy link
Owner

jbikker commented Feb 4, 2025

In fact, could you submit this as a PR in the dev branch?

@csc14gg
Copy link
Contributor Author

csc14gg commented Feb 4, 2025

Will do sure!

@csc14gg
Copy link
Contributor Author

csc14gg commented Feb 4, 2025

#102

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