PDA

View Full Version : help with signals and slots



superutsav
4th May 2006, 12:28
Hi,

I'm trying to create a class which includes signals and slots. I get the following errors on compilation. Please help.


main.o(.text+0x56d5): In function `controls::controls[not-in-charge](QWidget*)':
/home/utsav/FYP/final/controls.cpp:13: undefined reference to `vtable for controls'
main.o(.text+0x56e1):/home/utsav/FYP/final/controls.cpp:13: undefined reference to `vtable for controls'
main.o(.text+0x59bd): In function `controls::controls[in-charge](QWidget*)':
/home/utsav/FYP/final/controls.cpp:13: undefined reference to `vtable for controls'
main.o(.text+0x59c9):/home/utsav/FYP/final/controls.cpp:13: undefined reference to `vtable for controls'
main.o(.text+0x5f52): In function `controls::emitvalue()':
/home/utsav/FYP/final/controls.cpp:76: undefined reference to `controls::triggered(int)'
main.o(.gnu.linkonce.t._ZN8controlsD1Ev+0xc): In function `controls::~controls [in-charge]()':
/usr/local/Trolltech/Qt-4.1.0/include/QtCore/qpoint.h:101: undefined reference to `vtable for controls'
main.o(.gnu.linkonce.t._ZN8controlsD1Ev+0x18): In function `controls::~controls [in-charge]()':
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qcolor.h:217: undefined reference to `vtable for controls'


Thanks
superutsav

L.Marvell
4th May 2006, 12:34
Didn't you forget Q_OBJECT in your class with signals and slots?

superutsav
4th May 2006, 12:40
Didn't you forget Q_OBJECT in your class with signals and slots?

I have put Q_OBJECT in the class declaration. It still gives the erorrs.

Thanks
superutsav

superutsav
4th May 2006, 12:49
Got it... apparently you have to also run qmake -project, before qmake, make when u include signals and slots.
Thanks for the help
superutsav