title: LNK2019: unresolved external symbol public
body: <p>I'm trying to write my code in Visual Studio 2013 for second time in CodeBlocks, I am getting an error while trying to arrange a Binary Search Tree,
  here is my code for
  BinarySearchTree.h</p>
  
  <pre><code>#pragma once
  template &lt;typename T&gt;
  class BinarySearchTree{
  private:
      struct Node{
          Node *left;
          Node *right;
          T data;
      };
      Node *root;
  public:
      BinarySearchTree();
      bool isEmptyTree() const;
      void insertInBinarySearchTree(T&amp; value);
      void removeFromBinarySearchTree(T&amp; value);
      void printBinarySearchTree();
      void inorderBinarySearchTree(Node *p);
  };
  </code></pre>
  
  <p>Here is BinarySearchTree:</p>
  
  <pre><code>#include "BinarySearchTree.h"
  #include &lt;iostream&gt;
  #include &lt;new&gt;
  using namespace std;
  
  template &lt;typename T&gt;
  BinarySearchTree&lt;T&gt;::BinarySearchTree(){
      root = nullptr;
  }
  
  template &lt;typename T&gt;
  void BinarySearchTree&lt;T&gt;::insertInBinarySearchTree(T&amp; value){
      Node *t = new Node;
      Node *parent;
      t-&gt;data = value;
      t-&gt;left = nullptr;
      t-&gt;right = nullptr;
      parent = nullptr;
      if (isEmptyTree()) root = t;
      else{
          Node *currentNode;
          currentNode = root;
          while (currentNode){
              parent = currentNode;
              if (t-&gt;data, currentNode-&gt;data) currentNode = currentNode-&gt;right;
              else currentNode = currentNode-&gt;left;
          }
          if (t-&gt;data &lt; parent-&gt;data) parent-&gt;left = t;
          else parent-&gt;right = t;
      }
  }
  template &lt;typename T&gt;
  void BinarySearchTree&lt;T&gt;::removeFromBinarySearchTree(T&amp; value){
      bool isElementFound = false;
      if (isEmptyTree()){
          cout &lt;&lt; "This tree is empty!" &lt;&lt; endl;
          return;
      }
      Node *currentNode;
      Node *parent;
      currentNode = parent;
      while (currentNode != nullptr){
          if (currentNode-&gt;data == value){
              isElementFound = true;
              break;
          }
          else{
              parent = currentNode;
              if (value &gt; currentNode-&gt;data) currentNode = currentNode-&gt;right;
              else currentNode = currentNode-&gt;left;
          }
      }
      if (!isElementFound()){
          cout &lt;&lt; "Data not found in tree!" &lt;&lt; endl;
          return;
      }
      if ((currentNode-&gt;left == nullptr &amp;&amp; currentNode-&gt;right != nullptr) || (currentNode-&gt;left != nullptr &amp;&amp; currentNode-&gt;right == nullptr)){
          if (currentNode-&gt;left = nullptr &amp;&amp; currentNode-&gt;right != nullptr){
              if (parent-&gt;left == currentNode){
                  parent-&gt;left = currentNode-&gt;right;
                  delete currentNode;
              }
              else{
                  parent-&gt;right = currentNode-&gt;right;
                  delete currentNode;
              }
          }
          else{
              if (parent-&gt;left == currentNode){
                  parent-&gt;left = currentNode-&gt;left;
                  delete currentNode;
              }
              else{
                  parent-&gt;right = currentNode-&gt;left;
                  delete currentNode;
              }
          }
          return;
      }
  
      if (currentNode-&gt;left == nullptr &amp;&amp; current-&gt;right == nullptr){
          if (parent-&gt;left == currentNode) parent-&gt;left == nullptr;
          else parent-&gt;right == nullptr;
          delete currentNode;
          return;
      }
      if (currentNode-&gt;left == nullptr &amp;&amp; currentNode-&gt;right == nullptr){
          Node *checker;
          checker = currentNode-&gt;right;
          if ((checker-&gt;left == nulptr) &amp;&amp; (checker-&gt;right == nullptr)){
              currentNode = checker;
              delete checker;
              currentNode-&gt;right = nullptr;
          }
          else{
              if ((currentNode-&gt;right)-&gt;left != nullptr){
                  Node *leftCurrentNode;
                  Node *leftCurrentNodeParent;
                  leftCurrentNodeParent = currentNode-&gt;right;
                  leftCurrentNode = (currentNode-&gt;right)-&gt;left;
                  while (leftCurrentNode-&gt;left != nullptr){
                      leftCurrentNode = leftCurrentNodeParent;
                      leftCurrentNode = leftCurrentNode-&gt;left;
                  }
                  currentNode-&gt;data = leftCurrentNode-&gt;data;
                  delete leftCurrentNode;
                  leftCurrentNodeParent-&gt;left = nullptr;
              }
              else{
                  Node *temporaryNode;
                  temporaryNode = currentNode-&gt;right;
                  currentNode-&gt;data = temporaryNode-&gt;data;
                  currentNode-&gt;right = temporaryNode-&gt;right;
                  delete temporaryNode;
              }
          }
          return;
      }
  }
  template &lt;typename T&gt;
  void BinarySearchTree&lt;T&gt;::printBinarySearchTree(){
      inorderBinarySearchTree(root);
  }
  template &lt;typename T&gt;
  void BinarySearchTree&lt;T&gt;::inorderBinarySearchTree(Node *p){
      if (p != nullptr){
          if (p-&gt;left) inorderBinarySearchTree(p-&gt;left);
          cout &lt;&lt; " " &lt;&lt; p-&gt;data &lt;&lt; " ";
          if (p-&gt;right) inorderBinarySearchTree(p-&gt;right);
      }
      return;
  }
  template &lt;typename T&gt;
  bool BinarySearchTree&lt;T&gt;::isEmptyTree() const{
      return root == nullptr;
  }
  </code></pre>
  
  <p>And finally main.cpp:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "BinarySearchTree.h"
  using namespace std;
  
  int main()
  {
      BinarySearchTree&lt;int&gt; BST;
      int ch, tmp, tmp1;
      while (1)
      {
          cout &lt;&lt; endl &lt;&lt; endl;
          cout &lt;&lt; " Binary Search Tree Operations " &lt;&lt; endl;
          cout &lt;&lt; " ----------------------------- " &lt;&lt; endl;
          cout &lt;&lt; " 1. Insertion/Creation " &lt;&lt; endl;
          cout &lt;&lt; " 2. Removal " &lt;&lt; endl;
          cout &lt;&lt; " 3. Print " &lt;&lt; endl;
          cout &lt;&lt; " 4. Exit " &lt;&lt; endl;
          cout &lt;&lt; " Enter your choice : ";
          cin &gt;&gt; ch;
          switch (ch)
          {
          case 1: cout &lt;&lt; " Enter Number to be inserted : ";
              cin &gt;&gt; tmp;
              BST.insertInBinarySearchTree(tmp);
              break;
          case 2: cout &lt;&lt; " Enter data to be deleted : ";
              cin &gt;&gt; tmp1;
              BST.removeFromBinarySearchTree(tmp1);
              break;
          case 3: cout &lt;&lt; endl;
              cout &lt;&lt; " Print tree " &lt;&lt; endl;
              cout &lt;&lt; " -------------------" &lt;&lt; endl;
              BST.printBinarySearchTree();
              break;
          case 4:
              return 0;
          }
      }
  }
  </code></pre>
  
  <p>I found this error to be responsible for missing implementation, but I can't find function without implementation.</p>