Qt Error: undefined reference to `vtable for

I was receiving this error once, when I was trying to add signals & slots to one of my classes. I figured out that Qt was having problems with moc files, and there were no moc files being generated.

To solve the problem, I specified “moc directory” in the project’s .pro file:

OBJECTS_DIR = debug/obj
MOC_DIR = debug/moc

And my problem was solved šŸ˜€