Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-57

Saving the cpp file will exclude the moc_xxxx.cpp from build (i.e. ExcludedFromBuild="true")

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 1.1.8
    • 1.1.7
    • General
    • None
    • Microsoft Visual Studio 2008
      Windows 7

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jbornema Joerg Bornemann
            erha erha
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes