Original Post
I've stared at this all day, and i just can't find what's wrong. This is what i have: vector.h: vector.cpp: main.cpp: And i'm getting this: 1>main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector3::set(float,float,float)" (?set@?$Vector3@M@Cyb@@QAEXMMM@Z) referenced in function _main 1>D:\Projects\Cyb test\Debug\Cyb test.exe : fatal error LNK1120: 1 unresolved externals I'm using Visual studio 2008, wich i'm completley new to. What am i doing wrong?
template <class T>
class Vector3 {
public:
T x, y, z;
Vector3<T>(T nx = 0, T ny = 0, T nz = 0) : x(nx), y(ny), z(nz) {}
Vector3<T>(const Vector3<T> &v) : x(v.x), y(v.y), z(v.z) {}
.......
void set(const T nx, const T ny, const T nz);
...
};
template <class T>
void Vector3<T>::set(const T nx, const T ny, const T nz)
{
x = nx;
y = ny;
z = nz;
}
Vector3<float> vec1;
vec1.set(1, 2, 3);