high_flyer
4th August 2006, 23:02
Hi,
I have the following case:
Class MTelemetry is defined in an H file, at the moment its an empty class, implementing the defalut constructor and destructor in the H file it self, so there is no implementation file for it.
I subclass it to class MServCon.
Compiling goes well, but the linker complains:
obj/mservcon.o: In function `MServCon::MServCon(QObject*)':
mservcon.cpp:(.text+0x14): undefined reference to `vtable for MTelemetry'
MServCon includes mtelemetry.h.
I tried adding a forward declaration to MServCon, didn't help.
What I might be missing?
Here is the link line:
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.1.4/lib -o TMServCon obj/main.o obj/mservcon.o obj/moc_mservcon.o -L/usr/local/Trolltech/Qt-4.1.4/lib -lQtNetwo
Thanks.
Ofcourse one second oafter I posted I realized the problem - MTelemetry didn't get moc'ed...
I have the following case:
Class MTelemetry is defined in an H file, at the moment its an empty class, implementing the defalut constructor and destructor in the H file it self, so there is no implementation file for it.
I subclass it to class MServCon.
Compiling goes well, but the linker complains:
obj/mservcon.o: In function `MServCon::MServCon(QObject*)':
mservcon.cpp:(.text+0x14): undefined reference to `vtable for MTelemetry'
MServCon includes mtelemetry.h.
I tried adding a forward declaration to MServCon, didn't help.
What I might be missing?
Here is the link line:
g++ -Wl,-rpath,/usr/local/Trolltech/Qt-4.1.4/lib -o TMServCon obj/main.o obj/mservcon.o obj/moc_mservcon.o -L/usr/local/Trolltech/Qt-4.1.4/lib -lQtNetwo
Thanks.
Ofcourse one second oafter I posted I realized the problem - MTelemetry didn't get moc'ed...