Unresolved external symbol,confused
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix">What is an undefined reference/unresolved external symbol error and how do I fix it?</a>  </p>
</blockquote>



<p>I have a median function that finds a median from elements of the array as follows</p>

<p><strong>median.h</strong></p>

<pre><code>template &lt;class N&gt;
N median (N*,size_t);
</code></pre>

<p><strong>median.cpp</strong></p>

<pre><code>#include "median.h"
template &lt;class N&gt; 
 N median (N* numbers,size_t size){
    size_t mid = size/2;
    return size % 2 == 0? (numbers[mid] + numbers[mid-1])/2 : numbers[mid];
}
</code></pre>

<p><strong>main</strong></p>

<pre><code>#include &lt;iostream&gt;
#include "median.h"

using namespace std;

int main(){
    double Numbers [] = {1,2,3,4,5,6,7};


    size_t size = sizeof(Numbers)/sizeof(*Numbers);

    double med = median(Numbers,size);
    cout &lt;&lt; med &lt;&lt; endl;
    return 0;

}
</code></pre>

<p>But I get the following error</p>

<pre><code>main.obj : error LNK2019: unresolved external symbol "double __cdecl median&lt;double&gt;(double *,unsigned int)" (??$median@N@@YANPANI@Z) referenced in function _main
</code></pre>
