   Linker Error: Unresolved External Symbol
  I get a linker error when I try to compile my program. Here is the revelant code:From Network.h:class Client{public:template <class Class> void SendPacket(Class object, unsigned char packetID, int packetStream);   //other stuff removed due to irrelevancy...};From Client.cpp:template <class Class>void Client::SendPacket(Class object, unsigned char packetID, int packetStream){IdentifiedPacket <Class> data(packetID, object);client->Send((char*) data, sizeof(TemplatedClass<Classy>), HIGH_PRIORITY, RELIABLE_ORDERED, packetStream);}From main.cpp:if(input.CheckKey(SDLK_a, SDL_KEYDOWN)){cli->SendPacket(true, TEXT_STATE, 1);}else if(input.CheckKey(SDLK_a, SDL_KEYUP)){cli->SendPacket(false, TEXT_STATE, 1);}Error I get:main.obj : error LNK2019: unresolved external symbol "public: void __thiscall Client::SendPacket<bool>(bool,unsigned char,int)" (??$SendPacket@_N@Client@@QAEX_NEH@Z) referenced in function "void __cdecl InputCheck(void)" (?InputCheck@@YAXXZ)I am including Network.h into both files. This is the only error I get. Any help would be greatly appreciated. Thanks.   
Quote:Original post by PunaProgrammer chrisI get a linker error when I try to compile my program. Here is the revelant code:*** Source Snippet Removed ***I am including Network.h into both files. This is the only error I get. Any help would be greatly appreciated. Thanks.Hello,I only see the declaration of the function. Where is its definition? It should also be in the header file.HTH,   ;  Umm... the definition is right in the Client.cpp. And I shouldn't put it in the header file, because it is being included into multiple cpp files.Edit: Assuming by "the function", you are refering(sp?) to SendPacket.   ;Quote:Original post by PunaProgrammer chrisUmm... the definition is right in the Client.cpp. And I shouldn't put it in the header file, because it is being included into multiple cpp files.It's a template function - you have no choice but to put it in your header file :) Don't worry. Because of its template nature, the compiler will not instantiate it when he'll find the definition - he is going to instantiate it when he finds the uses.  You don't have to fear the multiple redefinition problem in this particular case.HTH,   ;  I tried that before, but apparently after I moved it to the header, I needed to do a clean build. Heh. Thanks for the template help.Edit: new compile error though now... new thread!   