Reputation: 532
I'm currently working on a graphics project, and have come across an issue. I have two separate cpp files that both require the glm gtx extensions. The problem is, when both files #include "glm/ext.hpp", I get the following error: "duplicate symbol glm::floor_log2(unsigned int)".
I understand what the error means, and what is causing it (each compilation unit having its own version of the "glm::floor_log2(unsigned int)" function), but I don't understand how to get around it. Both files require access to the ext header, and will not compile without it (though together, they will not link).
How do I go about properly getting my project to compile and link?
Upvotes: 0
Views: 209
Reputation: 213636
As far as I can tell, the floor_log2
is declared in integer.hpp
(without inline
keyword), and defined in integer.inl
(included from integer.hpp
).
It is a bug in the glm
source.
You should add inline
to the declaration in integer.hpp
(which will fix your problem) and notify developers of glm
that they have a bug.
Upvotes: 1