Page 1 of 1

QObject derivatives in CodeLite: Q_OBJECT macro failing:

Posted: Sun Jun 30, 2013 11:36 pm
by mikey
Using CodeLite 5.1.2 on Ubuntu RR/Gnome with Qt 4.8.1, default C++ Gtk toolchain.

CodeLite 5.1.2 works very well with Qt. My include paths are:

Code: Select all

    /usr/include/qt4
    /usr/include/qt4/QtCore
    /usr/include/qt4/QtGui

But when writing QObject derived classes, adding the Q_OBJECT macro to the class declaration causes a compiler error:

Code: Select all

'...undefined reference to `vtable for MyQObjectClass'
How do I fix this using the CodeLite IDE?

Re: QObject derivatives in CodeLite: Q_OBJECT macro failing:

Posted: Mon Jul 01, 2013 8:12 am
by eranif
IIRC, When adding Q_OBJECT, you should run qmake again - this will generate the moc_* files
You should then add those moc_* files to the workspace and compile

Eran

Re: QObject derivatives in CodeLite: Q_OBJECT macro failing:

Posted: Mon Jul 01, 2013 7:38 pm
by mikey
OK - anyhow, thanks for the help.

As it is, I've been trying to decide whethere to use GTK+/gtkmm or Qt, and I think I've decided to go with the GTK options. Qt binds you too much to their own framework IMO. Thanks to your help on StackOverflow.com I've got gtkmm up and running very nicely and I found some good docs about it. Using Glade, not to build my GUI's but just to learn the names of the widgets, properties etc and see how they interact. Then I code it myself. Found that using Glade with Gtk::Builder is too opaque and restrictive. I like to see the source code. I know you have wxbuilder in there with codelite and it generates code, but wxWidgets didn't feel very intuitive to me.


BTW, I'm an advocate and supporter of codelite - try to give a few bucks every month. I had been searching for an IDE that I felt comfortable with for a long time and codelite is perfect for me.

Thanks,
L'hitraot