title: Creating a template class object using a template constructor
body: <p>I'm having trouble creating a class object from a template class in which I need the constructor to also be a template and accept a parameter when the object is created.  However, when I attempt to create the object, I receive an error message stating that I'm referencing something that doesn't exist.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>using namespace std;
  #include &lt;cstdlib&gt;
  
  template &lt;class Node_Type&gt;
  class BinaryTree 
  {
  public:
      BinaryTree(Node_Type);
      BinaryTree(Node_Type, Node_Type);
      BinaryTree(Node_Type, Node_Type, Node_Type);
      bool isEmpty();
      Node_Type info();
      Node_Type inOrder();
      Node_Type preOrder();
      Node_Type postOrder();
  
  
  private:
      struct Tree_Node
  {
      Node_Type Node_Info;
      BinaryTree&lt;Node_Type&gt; *left;
      BinaryTree&lt;Node_Type&gt; *right;
  };
  
  Tree_Node *root;
  
  };
  
  #endif
  </code></pre>
  
  <p>and my .cpp:</p>
  
  <pre><code>template &lt;class Node_Type&gt;
  BinaryTree&lt;Node_Type&gt;::BinaryTree(Node_Type rootNode) {
  
      root = rootNode;
      root-&gt;left = NULL;
      root-&gt;right = NULL;
  
  }
  </code></pre>
  
  <p>There's more to the .cpp, but it's just other function members that are irrelevant.  My constructor shown above is what I can't get to work.</p>
  
  <p>In my main, I'm attempting to declare my object with the call:</p>
  
  <pre><code>BinaryTree&lt;char&gt; node('a');
  </code></pre>
  
  <p>but when I try this, I get an error message stating:</p>
  
  <pre><code>undefined reference to `BinaryTree&lt;char&gt;::BinaryTree(char)'
  </code></pre>
  
  <p>I've been trying to figure this out for two days now.  I've Googled every topic I can think of and read countless examples on Stack Overflow and other sources with no help.  Can anyone please explain what my problem is?  I know how to do my project, and I'd be finished by now if the syntax wasn't so ridiculous in C++.  Thanks in advance!</p>