Mail Archives: djgpp/1998/03/17/14:59:09
I am making a set of easy to use templates, and linking them into a file
called USEFUL.A, then when i go to compile these with a program TEST.CC
the compiler gives me the error message: Undefined reference to
class<T>::function()
Here is the source code that I use
in LIST.H
#ifndef LIST_H
#define LIST_H
template<class T> class List {
private:
public:
};
#endif
in list.cc
include "list.h"
// Implementations go here
in test.cc
include "list.h"
void main() {
List<int> list;
//do list functions
}
Compile String 1 is: gcc -g -c list.cc -o useful.a // This works OK
Compile String 2 is: gcc test.cc useful.a -o test.exe // This give the
error
Any amount of help would be apprieciated
- Raw text -