как разбить шаблон на хидер и спп?
template<class T>
Owner.h
class Owner
{
public:
void foo(int x);
private:
int x;
};
Owner.cpp
template<class T> void Owner<T>::foo(int x)
{
this->x = x;
}
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<int>::~Vector<int>(void)" (??1?$Vector@H@@QAE@XZ) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<int>::remove(int,int)" (?remove@?$Vector@H@@QAEXHH@Z) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<int>::add(int,int &)" (?add@?$Vector@H@@QAEXHAAH@Z) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<int>::push_back(int &)" (?push_back@?$Vector@H@@QAEXAAH@Z) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<int>::Vector<int>(void)" (??0?$Vector@H@@QAE@XZ) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<int>::Vector<int>(class Vector<int> &)" (??0?$Vector@H@@QAE@AAV0@@Z) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: int __thiscall Vector<int>::size(void)" (?size@?$Vector@H@@QAEHXZ) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<int>::Vector<int>(int)" (??0?$Vector@H@@QAE@H@Z) referenced in function "void __cdecl test0(void)" (?test0@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<struct Unit1>::~Vector<struct Unit1>(void)" (??1?$Vector@UUnit1@@@@QAE@XZ) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<struct Unit1>::Vector<struct Unit1>(int)" (??0?$Vector@UUnit1@@@@QAE@H@Z) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<struct Unit1>::add(int,struct Unit1 &)" (?add@?$Vector@UUnit1@@@@QAEXHAAUUnit1@@@Z) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<struct Unit1>::remove(int,int)" (?remove@?$Vector@UUnit1@@@@QAEXHH@Z) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: int __thiscall Vector<struct Unit1>::size(void)" (?size@?$Vector@UUnit1@@@@QAEHXZ) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: void __thiscall Vector<struct Unit1>::push_back(struct Unit1 &)" (?push_back@?$Vector@UUnit1@@@@QAEXAAUUnit1@@@Z) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
1>task4.obj : error LNK2019: unresolved external symbol "public: __thiscall Vector<struct Unit1>::Vector<struct Unit1>(void)" (??0?$Vector@UUnit1@@@@QAE@XZ) referenced in function "void __cdecl test1(void)" (?test1@@YAXXZ)
у меня пишет ошибки линковки