Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
The following code does not compile in VS 2010 Visual C++.
I get the error:
error LNK2019: unresolved external symbol "public: __thiscall
testTemplate<double>::testTemplate<double>(void)" (??0?
$testTemplate@N@@QAE@XZ) referenced in function _main main.obj
But if I move the code between
[code]// Begin Comment[/code]
and
[code]// End Comment[/code]
into the file main.cpp, the code compiles.
I am not sure why the compiler is complaining about the testTemplate
class but not about the test class.
I appreciate any help in this matter. Thanks
[code]
//File test.h
#include "stdafx.h"
template<typename T>
class testTemplate
{ protected: T templateKey_;
public : testTemplate();
};
class test
{
protected: int key_;
public: test();
};
//----------------------------------