Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-68014

Qt library link errors in Windows

XMLWordPrintable

    • f66c1db16c050c9d685a44a38ad7c5cf9f6fcc96 (qt/qtbase/dev)

      Have link error:

      mydialog.obj:-1: error: LNK2001: unresolved external symbol "struct QMetaObject const MyLibrary::staticMetaObject" (?staticMetaObject@MyLibrary@@3UQMetaObject@@B)

      Error happen because of the following line in code (disappears when commented out):

      mydialog.cpp:

      QMetaEnum myEnum = QMetaEnum::fromType<MyLibrary::MyEnumClass>();

      mylibrary.h:

      namespace MyLibrary
      { 
      Q_NAMESPACE 
      
      enum class MYLIBRARYSHARED_EXPORT MyEnumClass
      {
      ...
      }; 
      
      Q_ENUM_NS(MyEnumClass)
      
      ...
      } // namespace MyLibrary

      Error reproducible building this project under Windows:
      https://github.com/akontsevich/ConnectedCreatorPlugin

      Found no solution in Internet, seems Qt bug.

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

            taipan BogDan Vatra
            jirauser39314 user-45b5b (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes