undefined reference
<p>i have these classes (and function):</p>

<pre><code>template &lt;class A>
class Factory{
  public:
    A (*binOp(void))(A,A);
};
int sum(int a, int b){
  return a + b;
}
class IntFactory : public Factory&lt;int>{
  public:
    int (*binOp(void))(int,int){
      return &amp;sum;
    }
};
template &lt;class A>
class SpecializedList{
  protected:
    List&lt;A>* list;
    Factory&lt;A>* factory;
  public:
    SpecializedList(List&lt;A>* list,Factory&lt;A>* factory){
      this -> list = list;
      this -> factory = factory;
    }
    A sum(){
      return (list -> foldLeft(factory -> zero(), factory -> binOp()));
    }
};

// in main
SpecializedList&lt;int>* sl = new SpecializedList&lt;int>(join1 -> getList(),new IntFactory());
cout &lt;&lt; sl -> sum() &lt;&lt; endl;
</code></pre> 

<p>I get errors:
<code><pre>
/tmp/ccxdiwUF.o: In function <code>SpecializedList&lt;int&gt;::sum()':
list.cpp:(.text._ZN15SpecializedListIiE3sumEv[SpecializedList&lt;int&gt;::sum()]+0x19): undefined reference to</code>Factory::binOp()'
list.cpp:(.text._ZN15SpecializedListIiE3sumEv[SpecializedList::sum()]+0x2c):  `Factory::zero()'
collect2: ld returned 1 exit status
</pre></code>
Do anybody know why?
I was googling relevant part of the error messages, and it looked like it's related to problems, when one has the code scattered in different files. I have everything in single file for now.</p>
