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

Compilation issues with meta object systems

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 3.3.1 (rev.39)
    • None
    • Windows
    • Windows

    Description

      If a QObject derived class declares the Q_OBJECT macro in. h, and the definition of this class is wrapped by other preprocessors, such as the following: 

      #ifdef Q_OS_WIN 
      class KWordConverter : public QObject 

      {       Q_OBJECT public:            KWordConverter(); }

       
      #endif 

      In this case, no meta object data will be generated for the KWordConverter class, resulting in link failure: 
      Unresolvable external symbol 'public: virtual struct QMetaObject const * __cdecl KWordConverter:: metaObject (void) const' ? metaObject@KWordConverter  @@UEBAPEBUQMetaObject@@XZ) 
      If it has not been pre processed by # ifdef Q_OS_WIN, there will be no problem. The previous version of VSTools(2.9) also did not have this issue. I have checked the compilation configuration and it is also fine:

      Attachments

        Issue Links

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

          Activity

            People

              mecfc Miguel Costa
              vikiwei wang wei
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes