title: error LNK2019: unresolved external symbol - msvc debug build for function template
body: <p>I am getting error LNK2019 only during MSVC debug build for following type of code structure for function 'doSomething'. The code compiles fine for optimized build. Can somebody please help?</p>
  
  <p>//header file - abc.h</p>
  
  <pre><code>class __declspec(dllimport) Test /* some functions of class Test are defined in DLL - abc */ {
     // members
     public: 
     template &lt;typename T&gt;
     _forceinline int doSomething(T var)
     { 
        //do some thing
        return var.size(); 
     }
  }
  </code></pre>
  
  <p>//cpp file </p>
  
  <pre><code> /*part of another DLL which does not link to DLL 'abc' */
      #include "abc.h"
      int main() {
          Test t; 
          Test1 var1; 
          t.doSomething( var1 );
      }
  </code></pre>