Original Post
Ok I'm having some trouble templating. I've only done one template function and that was over 4 years ago and am having some trouble. mainCharacter.h mainCharacter.cpp I plan on calling checkObjectCollision(allTiles) and checkObjectCollision(allWaters) and they are defined as follows I also plan on checking for quite a few other things or else I wouldn't bother with templating Everything compiles fine but I get this link error: error LNK2019: unresolved external symbol "public: void __thiscall mainCharacter::checkObjectCollision > >(class std::vector >)" (??$checkObjectCollision@V?$vector@Vtile@@V?$allocator@Vtile@@@std@@@std@@@mainCharacter@@QAEXV?$vector@Vtile@@V?$allocator@Vtile@@@std@@@std@@@Z) referenced in function "void __cdecl display(void)" (?display@@YAXXZ) I'm guessing it has something to do with std::allocator but don't really know. Any help would be greatly appreciated and also let me know if I'm doing something totally wrong or if there is a better way. Thanks
template<typename T>
void checkObjectCollision( T objects );
template<typename T>
void mainCharacter::checkObjectCollision( T objects )
{
}
struct myStruct
{
vector<tile> allTiles;
vector<water> allWaters;
};