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