I wrote a simple test as follow:
#include <QCoreApplication>
#include <QObject>
class Foo : public QObject
{
Q_OBJECT
};
class foo1
{
};
int main(int argc, char* argv[])
{
QCoreApplication a(argc, argv);
Foo f;
return a.exec();
}
Which gives me an error:
error: undefined reference to `vtable for Foo':
However, when I change Foo f
to Foo f()
, it complies without any error.
So my question is what is the different between f
and f()
?