console.cpp:
#include <iostream>
#include <string>
#include <vector>
using namespace std;
template <typename T>
T
#ifndef _DEBUG
&
#endif
val(const T& x);
class A
{
private:
public:
void f();
};
void A::f()
{
val(1);// deleting val solves the problem
}
int main()
{
new A;
cin.get();
}
general.cpp:
template <typename T>
T
#ifndef _DEBUG
&
#endif
val(const T& x)
{
return x;
}
the error:
Error 2 fatal error LNK1120: 1 unresolved externals G:\Important Files\My Documents\Visual Studio 2008\Projects\tack\Debug\tack.exe
I don't understand why my program has errors!?