title: Shared library with template parameters
body: <p>Created shared library with below file</p>
  
  <pre><code>example.cpp
  #include &lt;iostream&gt;
  template &lt;typename T&gt;
  T  Max (T &amp; a, T &amp; b) 
  { 
      return a &lt; b ? b:a; 
  } 
  </code></pre>
  
  <p>I was trying to use above library in my code</p>
  
  <pre><code>test.cpp
  #include &lt;stdio.h&gt;
  #include &lt;iostream&gt;
  using namespace std;
  
  template int  Max &lt;int&gt; (int &amp; a, int &amp; b);
  template double  Max &lt;double&gt; (double &amp; a, double &amp; b);
  
  int main ()
  {
      int i = 39;
      int j = 20;
      cout &lt;&lt; "Max(i, j): " &lt;&lt; Max(i, j) &lt;&lt; endl; 
      double f1 = 13.5; 
      double f2 = 20.7; 
      cout &lt;&lt; "Max(f1, f2): " &lt;&lt; Max(f1, f2) &lt;&lt; endl; 
      return 0;
  }
  </code></pre>
  
  <p>when I compiled above code ,getting the following error</p>
  
  <pre><code>test.cpp:4: error: explicit instantiation of non-template ‘int Max’
  test.cpp:4: error: expected ‘;’ before ‘&lt;’ token
  test.cpp:5: error: explicit instantiation of non-template ‘double Max’
  test.cpp:5: error: expected ‘;’ before ‘&lt;’ token
  test.cpp: In function ‘int main()’:
  test.cpp:11: error: ‘Max’ was not declared in this scope*
  </code></pre>