PDA

View Full Version : Q_object???



superutsav
21st February 2006, 14:03
Hi,
I'm trying to declare a slot called change() in my class myprocessor. so this is what i do:

#include <QObject>
class MyProcessor : public QObject
{
Q_OBJECT
public slots:
void change();
...and so on...

now, when i try to compile, this is what it throws back:

main.o(.gnu.linkonce.t._ZN11MyProcessorC1Ev+0x1c): In function `MyProcessor::MyProcessor[in-charge]()':
/usr/local/Trolltech/Qt-4.1.0/include/QtCore/arch/qatomic.h:70: undefined reference to `vtable for MyProcessor'
main.o(.gnu.linkonce.t._ZN11MyProcessorD1Ev+0xc): In function `MyProcessor::~MyProcessor [in-charge]()':
/usr/local/Trolltech/Qt-4.1.0/include/QtGui/qimage.h:164: undefined reference to `vtable for MyProcessor'
collect2: ld returned 1 exit status
make: *** [videochoice] Error 1


if i don't include the Q_OBJECT, the it says:

Object::connect: No such slot QObject::change()


What do i do??
superutsav

jacek
21st February 2006, 14:07
Have you run qmake after adding Q_OBJECT to your class?

http://www.qtcentre.org/forum/showthread.php?t=811

superutsav
21st February 2006, 14:29
Thanks, that did it..
superutsav