<p>Suppose I have <code>fileA.h</code> which declares a class <code>classA</code> with template function <code>SomeFunc&lt;T&gt;()</code>. This function is implemented directly in the header file (as is usual for template functions). Now I add a specialized implementation of <code>SomeFunc()</code> (like for <code>SomeFunc&lt;int&gt;()</code>) in <code>fileA.C</code> (ie. not in the header file).</p>

<p>If I now call <code>SomeFunc&lt;int&gt;()</code> from some other code (maybe also from another library), would it call the generic version, or the specialization?</p>

<p>I have this problem right now, where the class and function live in a library which is used by two applications. And one application correctly uses the specialization, while another app uses the generic form (which causes runtime problems later on). Why the difference? Could this be related to linker options etc? This is on Linux, with g++ 4.1.2.</p>

Unless the specialized template function is also listed in the header file, the other application will have no knowledge of the specialized version.  The solution is the add
```
SomeFunc<int>()
```
to the header as well.