I get unresolved external symbols concerning Q_OBJECT
Solved
General and Desktop
-
unresolved external symbol "public: virtual struct QMetaObject const * __cdecl VectorModel::metaObject(void)const " (?metaObject@VectorModel@@UEBAPEBUQMetaObject@@XZ::<!VectorModel>) unresolved external symbol "public: virtual void * __cdecl VectorModel::qt_metacast(char const *)" (?qt_metacast@VectorModel@@UEAAPEAXPEBD@Z::<!VectorModel>) unresolved external symbol "public: virtual int __cdecl VectorModel::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@VectorModel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z::<!VectorModel>)
I am using C++ 20 modules....
-
when I remove VectorModel from a C++ 20 module, I get the opposite linker warnings (multiply defined symbols found) - why??
1>moc_VectorModel.obj : error LNK2005: "public: static struct QMetaObject const VectorModel::staticMetaObject" (?staticMetaObject@VectorModel@@2UQMetaObject@@B) already defined in moc_VectorModelImpl.obj 1>moc_VectorModel.obj : error LNK2005: "private: static void __cdecl VectorModel::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@VectorModel@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z) already defined in moc_VectorModelImpl.obj
and others...
-
This post is deleted!
-