title: error C2995:function template has already been defined
body: <p>there are many solutions to this question bot nothing answers my case.</p>
  
  <p>I am using VS 2008.I am tring to create a map using Binary search tree</p>
  
  <pre><code>#ifndef _map_h
  #define _map_h
  
  
  #include&lt;string&gt;
  using namespace std;
  
  template &lt;typename ValType&gt;
  class Map
  {
      public:
          Map();
          ~Map();
          ValType getvalue(string key);
          void add(string key,ValType value);
  
      private:
          struct node{
              string key;
              ValType value;
              node *right;
              node *left;
          };
          node *root;
  
          node *treeSearch(string key,node *t);
  
          void treeEnter(string key,ValType value,node *&amp;t);
  };
  #include"map.cpp"
  
  #endif
  </code></pre>
  
  <p><strong>map.cpp</strong></p>
  
  <pre><code>#include&lt;string&gt;
  #include&lt;iostream&gt;
  #include"map.h"
  using namespace std;
  
  template &lt;typename ValType&gt;
  Map&lt;ValType&gt;::Map(){
      root=NULL;
  }
  
  template &lt;typename ValType&gt;
  Map&lt;ValType&gt;::~Map(){
      delete root;
  }
  
  
  template &lt;typename ValType&gt;
  ValType Map&lt;ValType&gt;::getvalue(string key){
      node *found=treeSearch(key,root);
      if(found==NULL)
          cout&lt;&lt;"Couldnot Found the node";
      else return found-&gt;value;
  }
  
  template &lt;typename ValType&gt;
  typename Map&lt;ValType&gt;::node *Map&lt;ValType&gt;::treeSearch(string key,node *t){
      if(t==NULL) return NULL;
  
      if(t-&gt;key==key) return t;
  
      if(t-&gt;key&gt;key) treeSearch(key,t-&gt;left);
  
      else treeSearch(key,t-&gt;right);
  }
  
  template &lt;typename ValType&gt;
  void Map&lt;ValType&gt;::add(string key,ValType value){
      treeEnter(key,value,root);
  }
  
  template &lt;typename ValType&gt;
  void Map&lt;ValType&gt;::treeEnter(string key,ValType value,node *&amp;t){
      if(t==NULL){
          t-&gt;value=value;
          t-&gt;key=key;
          t-&gt;left=NULL;
          t-&gt;right=NULL;
      }
  
      else if(t-&gt;key==key) t-&gt;value=value;
  
      else if(t-&gt;key&gt;key) treeEnter(key,value,t-&gt;left);
  
      else treeEnter(key,value,t-&gt;right);
  }
  </code></pre>
  
  <p>Error:For all the functions its saying that they are already been defined.</p>
  
  <p>I am following Stanford online course and the same worked for the instructor(she was using mac)</p>