---
title: "Discussion on \"How to Solve Undefined Reference to Template Class Error of C++\" | Hashnode"
description: "Discussion on \"How to Solve Undefined Reference to Template Class Error of C++\". Recently, in my open-source project Num.NET, a problem puzzled me.\n\nThe problem\nI abstract my code as below: \ndefine.h\ntemplate<typename T>\nclass Methods{\npublic:\n    T methodA(T inp);\n    void methodB(vector<T> &inp, int c);\n}\nimpl.cpp\ntemplate<type..."
url: "https://hashnode.com/posts/how-to-solve-undefined-reference-to-template-class-error-of-c/621d89b2085330c3f79c7622"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to Solve Undefined Reference to Template Class Error of C++](https://yaohui.hashnode.dev/how-to-solve-undefined-reference-to-template-class-error-of-c?utm_source=hashnode&utm_medium=feed)

Recently, in my open-source project Num.NET, a problem puzzled me. The problem I abstract my code as below: define.h template<typename T> class Methods{ public: T methodA(T inp); void methodB(vector<T> &inp, int c); } impl.cpp template<type...

Mar 1, 2022 · 3 min read · yaohui.hashnode.dev  
Read the article

-   [#cpp](https://hashnode.com/tag/cpp)
-   [#bugs-and-errors](https://hashnode.com/tag/bugs-and-errors)
-   [#learning](https://hashnode.com/tag/learning)
-   [#coding](https://hashnode.com/tag/coding)

## Written by

[Yaohui Liu](https://hashnode.com/@AsakusaRinne)

@AsakusaRinne

  
[View profile](https://hashnode.com/@AsakusaRinne)

C++, HPC, ML, Algorithm and SDE

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
