Templated function being reported as “undefined reference” during compilation

前端 未结 3 724
长发绾君心
长发绾君心 2021-01-28 04:19

These are my files:

--------[ c.hpp ]--------

#ifndef _C
#define _C

#include
class C
{
public:
    template void ca         


        
3条回答
  •  离开以前
    2021-01-28 04:46

    Essentially, you cannot have related template declarations and definitions in separate files in current C++. You should fully define class C in one file.

提交回复
热议问题