I am getting an error when compiling the a code with templated class.
1 2 3 4 5 6
main.o: In function 'main':
/home/XXX/XXX/XXX/main.cpp:37: undefined reference to 'sort<int>::~sort()'
/home/XXX/XXX/XXX/main.cpp:37: undefined reference to 'sort<int>::~sort()'
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'project' failed
make: *** [project] Error 1
(The XXX are places holders)
The code around the error in main.cpp looks like this:
1 2
sort<int> mySort;
mySort.run(type, lower, upper, increase, file); //THIS IS LINE 37
If do have the ~sort deconstructor declared in sort.cpp. Why am I still getting an error?