Details
Description
Everytime when I save the xxxx.cpp file the moc_xxxx.cpp file will be excluded from Build (i.e. ExcludedFromBuild="true" is found in the project file). At the end the compilation failed as shown below.
1>formlogon.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall FormLogon::metaObject(void)const " (?metaObject@FormLogon@@UBEPBUQMetaObject@@XZ)
1>formlogon.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall FormLogon::qt_metacast(char const *)" (?qt_metacast@FormLogon@@UAEPAXPBD@Z)
1>formlogon.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall FormLogon::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@FormLogon@@UAEHW4Call@QMetaObject@@HPAPAX@Z)
1>formlogon.obj : error LNK2019: unresolved external symbol "protected: void __thiscall FormLogon::LogonCredential(class QString const &,class QString const &)" (?LogonCredential@FormLogon@@IAEXABVQString@@0@Z) referenced in function "private: void __thiscall FormLogon::DoLogon(void)" (?DoLogon@FormLogon@@AAEXXZ)
1>formlogon.obj : error LNK2001: unresolved external symbol "public: static struct QMetaObject const FormLogon::staticMetaObject" (?staticMetaObject@FormLogon@@2UQMetaObject@@B)
So now I have to toggle the Excluded From Build in the moc_xxxx.cpp file properties to "No", everytime I save the file....
I manage to remove all my code from the solution (solution attached - Qt-Bug.zip) and create one new form. And this new form have the same behaviour. You can try to edit the cpp file and after you save it the moc_xxxxxx.cpp will be excluded from building process.