title: error: ‘List’ is not a template type
body: <p>I am a beginner in c++ so please excuse me if I my mistakes below turn out to be silly. Still, I am stuck with my code and would appreciate any help.</p>
  
  <p>I get the following error when trying to compile through make via g++:</p>
  
  <pre><code>In file included from A.cpp:2:
  List.h:20: error: ‘List’ is not a template type
  A.cpp: In member function ‘void A::NowyObiekt(int)’:
  A.cpp:6: error: ‘list_a’ was not declared in this scope
  make: *** [A.o] Error 1
  </code></pre>
  
  <p>My code is separated into the following <em>tiny</em> files: </p>
  
  <ul>
  <li>A.h : <a href="http://pastebin.com/QQ04xx2j" rel="nofollow">http://pastebin.com/QQ04xx2j</a> (header)</li>
  <li><p>A.cpp : below</p>
  
  <pre><code>#include "A.h"
  #include "List.h"
  
  void A::NewObject(int i)
  {
          list_a.Add(i);
  }
  
  int A::Compare(int a, int b)
  {
          if ( a&gt;b ) return 1;
          if ( a&lt;b ) return -1;
          else return 0;
  }
  </code></pre></li>
  <li><p>List.h : below (header)</p>
  
  <pre><code>#ifndef LIST_H
  #define LIST_H
  template&lt;typename T&gt;
  class Node
  {
      Node()
      {
          nxt = pre = 0;
      }
      Node(const T&amp; el, Node *n = 0, Node *p = 0 )
      {
          dana = el; nxt = n; pre = p;
      }
      T dana;
      Node *nxt, *pre;
  };
  
  template&lt;typename T&gt;
  class List
  {
  public:
      List()
      {
          head = tail = 0;
      }
      void Add(const T&amp;);
  protected:
      Node&lt;T&gt; *head,*tail;
  };
  
  #endif
  </code></pre></li>
  <li><p>List.cpp : <a href="http://pastebin.com/a3HQ9yZ4" rel="nofollow">http://pastebin.com/a3HQ9yZ4</a></p></li>
  <li><p>prog.cpp : below (main)</p>
  
  <pre><code>#include "List.h"
  #include "A.h"
  
  int main()
  {
      int i = 5;
      class List list_a;
      class A obj;
  
      obj.Add(i);
  }
  </code></pre></li>
  <li><p>and the makefile is : <a href="http://pastebin.com/GTR5jW54" rel="nofollow">http://pastebin.com/GTR5jW54</a></p></li>
  </ul>
  
  <p>As noted, I am still a beginner, so please be understanding. I would be thankful for any help and clear explanations. Thanks in advance.</p>