VC++.NET2003中的模板问题?
//Test.h
#include <iostream>
using namespace std;
template<class Type>
class Test
{
Type data;
public:
Test(Type value)
{
data=value;
}
void Print();
};
//Test.cpp
#include "Test.h"
template<class Type>
void Test<Type>::Print()
{
cout<<data<<endl;
}
//Main.cpp
#include <iostream>
#include "Test.h"
using namespace std;
int main()
{
int a=10;
Test<int> test(10); //此行代码无错
test.Print(); //次行代码有错:LNK2019:无法调用Print()
return 0;
}
急救!!!!!!!!!!!!!!!!!!!!!!!!