Q) link error of template class

김용수 ispert@ifeelnet.com
Tue May 8 07:01:00 GMT 2001




Hi, I compile the source code with 
-frepo option as manual writes. But I have link errors as 
follows
 
BClass<STRT>::func1(void) 
testout.o BClass<STRT>::func1(void) testout.o ld : fatal : Symbol 
referencing errors. No out written to testout collect2: ld returned 1 exit 
status *** Error code 1 make: Fatal error: Command failed for target 
'testout'
 
 
Source code is as 
follows This code  is compose of  
three files(AClass.cpp, BClass.cpp, Main.cpp)
 
 
typedef struct {     
int i; } STRT; template<class T> class AClass { public 
: }; template<class T> class BClass : public 
AClass<T> { public :     void 
func1(void);     void func2(void); };
int main(int argc, char **argv)
{
       BClass<STRT> *a = 
new BClass<STRT>
}
Let me know how to solve the 
problem.



More information about the Gcc mailing list