undefined reference to <std::string>std::string&
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/456713/why-do-i-get-unresolved-external-symbol-errors-when-using-templates">Why do I get &ldquo;unresolved external symbol&rdquo; errors when using templates?</a><br>
  <a href="http://stackoverflow.com/questions/4368440/undefined-reference-to-a-template-class-function">&ldquo;undefined reference&rdquo; to a template class function</a>  </p>
</blockquote>



<p>I got error on line: <strong>Console::getInstance()->readObjectData(a);</strong> in main.cpp</p>

<p>undefined reference to <code>void Console::readObjectData&lt;std::string&gt;std::string&amp;)</code></p>

<p>Console.h
<a href="http://pastebin.com/WsQR7JNq" rel="nofollow">http://pastebin.com/WsQR7JNq</a></p>

<pre><code>#define CONSOLE_H
#include &lt;string&gt;

using namespace std;

class Console
{
public:
    static Console* getInstance();


    template &lt;typename T&gt;
    void readObjectData(T&amp; o);
protected:
private:
    Console();  // Private so that it can  not be called
    Console(Console const&amp;);             // copy constructor is private
    Console&amp; operator=(Console const&amp;);  // assignment operator is private
    static Console* m_pInstance;


};
    #endif // CONSOLE_H
</code></pre>

<p>Console.cpp
<a href="http://pastebin.com/N02HjgBw" rel="nofollow">http://pastebin.com/N02HjgBw</a></p>

<pre><code>#include "Console.h"
#include "Log.h"
#include &lt;iostream&gt;
#include &lt;sstream&gt;
#include &lt;string&gt;

using namespace std;

// Global static pointer used to ensure a single instance of the class.
Console* Console::m_pInstance = NULL;

Console::Console()
{

}

Console::Console(Console const&amp;)
{

}

Console&amp; Console::operator=(Console const&amp;)
{

}

Console* Console::getInstance()
{
if (!m_pInstance)   // Only allow one instance of class to be generated.
    m_pInstance = new Console;

return m_pInstance;
}


template &lt;typename T&gt;
void Console::readObjectData(T&amp; o) {
     //cin &gt;&gt; o;
}
</code></pre>

<p>main.cpp
<a href="http://pastebin.com/U6qAJUN1" rel="nofollow">http://pastebin.com/U6qAJUN1</a></p>

<pre><code>#include "Console.h"

using namespace std;

int main()
{

    string a;

    Console::getInstance()-&gt;readObjectData(a);
    return 0;
}
</code></pre>

<p>any ideas?</p>
