title: "error LNK2019: unresolved external symbol" when using templates
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/456713/why-do-i-get-unresolved-external-symbol-errors-when-using-templates">Why do I get &ldquo;unresolved external symbol&rdquo; errors when using templates?</a>  </p>
  </blockquote>
  
  
  
  <p>I am using templates in my code while there is always an error LNK2019. Here is part of my code:</p>
  
  <p>Method.h</p>
  
  <pre><code>template&lt;typename type&gt;
  void Method(Model&lt;type&gt;* sys);
  </code></pre>
  
  <p>Method.cpp</p>
  
  <pre><code>template&lt;typename type&gt;
  void Method(Model&lt;type&gt;* sys){ blablabla;}
  </code></pre>
  
  <p>Model.h</p>
  
  <pre><code>template&lt;typename type&gt;
  class Model{ blablabla;}
  
  class Model1:public Model&lt;double&gt;{ blablabla;}
  </code></pre>
  
  <p>Main.cpp</p>
  
  <pre><code>Model&lt;double&gt; *sys=new Model1();
  Method(sys);
  </code></pre>
  
  <p>However, there always shows an error LNK2019: unresolved external symbol "void __cdec1 Method(class Model*)" referenced in function_main. Anyone knows where I am going wrong? Thanks a lot!</p>