Last semester I took CSII and we built an unsorted list (C++). This summer I went thru the textbook and built an sorted list, and now I'm trying to template the sorted list, but i keep getting compiler errors like this...
: undefined reference to `SortedType<float>::SortedType()'
/tmp/cc0C4kB6.o(.text+0x448): In function `main':
: undefined reference to `SortedType<float>::GetLength() const'
/tmp/cc0C4kB6.o(.text+0x497): In function `main':
: undefined reference to `SortedType<float>::InsertItem(float)'
/tmp/cc0C4kB6.o(.text+0x551): In function `main':
: undefined reference to `SortedType<float>::DeleteItem(float)'
/tmp/cc0C4kB6.o(.text+0x61c): In function `main':
: undefined reference to `SortedType<float>::FindItem(float)'
/tmp/cc0C4kB6.o(.text+0x6aa): In function `main':
: undefined reference to `SortedType<float>::MakeEmpty()'
/tmp/cc0C4kB6.o(.text+0x6e4): In function `main':
: undefined reference to `SortedType<float>::ResetList()'
/tmp/cc0C4kB6.o(.text+0x744): In function `main':
: undefined reference to `SortedType<float>::PrintList()'
/tmp/cc0C4kB6.o(.text+0x763): In function `main':
: undefined reference to `SortedType<float>::GetLength() const'
/tmp/cc0C4kB6.o(.text+0x79f): In function `main':
: undefined reference to `SortedType<float>::IsFull() const'
/tmp/cc0C4kB6.o(.text+0x80a): In function `main':
: undefined reference to `SortedType<float>::IsEmpty() const'
collect2: ld returned 1 exit status
I checked the web first and this definitely is a linker error. Recommendations were to check function spelling, file inclusion etc. Since I copied the program over from the sorted list that I built over the last few days and am just adding templates (that program works fine), I think I might be missing something...