Compile header-only template library into a shared library?

后端 未结 4 1466
情深已故
情深已故 2020-12-15 11:11

We are in the process of designing a new C++ library and decided to go with a template-based approach along with some specific partial template specialisations for corner ca

4条回答
  •  感情败类
    2020-12-15 11:49

    C++ Shared Library with Templates: Undefined symbols error Some answers there cover this topic. To sum up short: it is possible if you force to instantiate templates in shared library code explicitly. It will require explicit specification for all used types for all used templates on shared lib side, though.

提交回复
热议问题