[Qt-interest] compile error after class refactoring

Luca Ferrari fluca1978 at infinito.it
Thu May 14 11:20:41 CEST 2009


Hi,
I've got a simple class that declares a couple of signals, and it worked. 
Today I moved some functions to a base class, making my class inheting from 
such base and the base inherits from QOBject (and uses the Q_OBJECT macro). 
But now the compiler produces an error when my class emits signals:

signal.o: In function `Signal::emitSignals()':
/mnt/disco2/sviluppo/qt/SigConsole/../SigConsole.src/signal.cpp:11: undefined 
reference to `Signal::integerSignal(int)'
/mnt/disco2/sviluppo/qt/SigConsole/../SigConsole.src/signal.cpp:14: undefined 
reference to `Signal::voidSignal()'
signal.o: In function `Signal':
/mnt/disco2/sviluppo/qt/SigConsole/../SigConsole.src/signal.cpp:3: undefined 
reference to `vtable for Signal'
/mnt/disco2/sviluppo/qt/SigConsole/../SigConsole.src/signal.cpp:3: undefined 
reference to `vtable for Signal'
collect2: ld returned 1 exit status


The class hierarchy is:
+ QObject
 - Base
   - Signal

What am I doing wrong?

Thanks,
Luca



More information about the Qt-interest-old mailing list