laas / metapod

A template-based robot dynamics library
GNU Lesser General Public License v3.0
14 stars 10 forks source link

including spatial in two compilation units leads to "double definition" errors at link time #37

Closed sbarthelemy closed 11 years ago

sbarthelemy commented 11 years ago

see the test added in the "clean_tests" branch to reproduce the problem.

Olivier, if you don't mind, I prefer you deal with this one.

olivier-stasse commented 11 years ago

Thanks for the feedback I am looking into it.

olivier-stasse commented 11 years ago

After various tests, I ended up by creating a metapod_core shared library for the implementation of the specialized operators. Any better solution is welcome, anyway if closes this issue.

sbarthelemy commented 11 years ago

what about adding inline markers to the offending functions? I believe this is what eigen does.

olivier-stasse commented 11 years ago

You are absolutely right. However the const initialization of m_S in the specialized template is more problematic. I did not find any workaround. Then I thought (probably wrongly) that we could put all the operators in a library to have a better control over the memory. But I can probably go back to an inline version of the operators.

sbarthelemy commented 11 years ago

Hello Olivier,

I'd like to have the whole of spatial (and metapod) templated by FloatType (which would then be a template argument instead of a mere typedef). (I'll open a feature request).

What would be the impact of this on the DSO solution?

olivier-stasse commented 11 years ago

Good point. I'll see if I can get read of the const problem.