I'm using g++ ver. 3.3.6 and got trouble as follows:
template<class T> virtual class CAbstractQueue
{
public:
CAbstractQueue(void){}
~CAbstractQueue(void){}
};
template<class T> class CQueue : public CAbstractQueue<T>
{
public:
CQueue(void): CAbstractQueue() {}
~CQueue(void){}
...
}
and the compiler returns:
main.o(.gnu.linkonce.t._ZN6CQueueIiED1Ev+0x16): In function
`CQueue<int>::~CQueue [in-charge]()':
: undefined reference to `CAbstractQueue::~CAbstractQueue
[not-in-charge]()'
main.o(.gnu.linkonce.t._ZN6CQueueIiEC1Ev+0xd): In function
`CQueue<int>::CQueue[in-charge]()':
: undefined reference to
`CAbstractQueue::CAbstractQueue[not-in-charge]()'
main.o(.gnu.linkonce.t._ZN6CQueueIiED0Ev+0x16): In function
`CQueue<int>::~CQueue [in-charge deleting]()':
: undefined reference to `CAbstractQueue::~CAbstractQueue
[not-in-charge]()'
main.o(.gnu.linkonce.r._ZTI6CQueueIiE+0x8): undefined reference to
`typeinfo for CAbstractQueue'
collect2: ld returned 1 exit status
I've used -fexternal to compile templates but in this case gives no
results. Can anyone give me a hand with that?
Thanks in advance for time and attention,
Matt
_______________________________________________
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus