c++ templates linker problem

Hello
I have an assignment for linked lists using inheritance & templates
I have a list that can take objects trucks & cars
The code for the constructor
/*list.cpp*/
template <class V> linked_list<V>::linked_list(short int d,string nm)
{
head=tail=NULL;
size=0;
debug=d;
name=nm;
}
/*main.cpp*/
#include "list.h"

linked_list<car> *list_car;
list_car=new linked_list<car>(debug,"Car_list");/*constructor*/

When i call constructor in main i get this compilation error

vehicle.cpp:(.text+0x4e7): undefined reference to `linked_list<car>::linked_list(short, std::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
when using templates you should have the function bodies in the header file
Thank you
U saved my life friend
It s been 5 hours trying to find what was wrong!!!!
Topic archived. No new replies allowed.