error: LNK2019 unresolved external symbol "public" in template Function
<p>i have a class to move , colorize , set text ...etc any GUI In the Window:</p>

<pre><code>class BasicOption
{
public : 
template &lt;class T&gt;
void SetPosition ( float x , float y , T const*Obj);
};
</code></pre>

<p>and define the function like this :</p>

<pre><code>template &lt;class T&gt;
void BasicOption::SetPosition ( float x , float y , T const*Obj)
{
this-&gt;Obj-&gt;SetPosition(x ,y );
}
</code></pre>

<p>i have class to create a Window like this </p>

<pre><code>class GUI_Window : public BasicOption

{
public:   // &lt;-- This colon was added in response to some answers
GUI_Window(float const&amp;width , float const&amp;height String const&amp;name)
};
</code></pre>

<p>OK every thing work correctly but if i call the SetPosition in the Main Function i get </p>

<pre><code>error: LNK2019 unresolved external symbol "public" 
</code></pre>

<p>main.cpp</p>

<pre><code>GUI_Window *W ; // MyWindow
int WINAPI wWinMain ( HINSTANCE hInst , HINSTANCE hPrev , LPWSTR lmcmdline , int nShowCmd )
{
..............
...........
..........
...........

W-&gt;SetPosition ( 520 , 250 , W );


}
</code></pre>

<p>also i change the code like this</p>

<pre><code>{
W-&gt;SetPosition &lt;GUI_Window&gt;( 520 , 250 , W );
}
</code></pre>

<p>but still have the same problem</p>

<p>/<strong>**</strong>/</p>

<p>Guys i found the problem </p>

<p>it is the linkage , i define the function in the main.cpp and it is work correctly 
but if i define it outside the main.cpp file i get error sow any help to link this function 
and define it outside main.cpp</p>
