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

Issues statically linking extension plugin on Windows Qt6

XMLWordPrintable

    • Windows

      Related Stackoverflow question

       

      I haven't been able to successfully link a static, prebuilt Extension Plugin. All examples require `qt_add_qml_module()`, which seems to require access to the source code.

       

      The closest I have gotten is access to the C++ classes within the plugin, but no access to the QML classes.

       

      When linking the external plugin in CMake the following error is generated:

      TestPplugin.lib(TestPplugin_TestPPlugin.cpp.obj):-1: error: LNK2019: unresolved external symbol "void __cdecl qml_register_types_TestP(void)" (?qml_register_types_TestP@@YAXXZ) referenced in function "private: static __cdecl <lambda_aae1ac3daa5dcd67ebc864db46295620>::<lambda_invoker_cdecl>(class QtPrivate::QMetaTypeInterface const *,void *)" (?<lambda_invoker_cdecl>@<lambda_aae1ac3daa5dcd67ebc864db46295620>@@CA@PEBVQMetaTypeInterface@QtPrivate@@PEAX@Z)

       where TestP is the name of the plugin class.

       

       

      Linking TestP.lib before TestPplugin (an action that isn't shown in any examples), we can access the C++ classes within the plugin, but the QML classes return "{ItemName} is unavailable. qrc:/TestP/{ItemName}.qml: No such file or directory}


      If I'm doing something wrong, it would be appreciated if someone could create an example where you:

      • Creates a new Quick App project in QtCreator
      • Creates a new Quick2ExtensionPlugin in QtCreator
      • Uses the Plugin in the App

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

            qtbuildsystem Qt Build System Team
            mairtin.s Mairtin Steinkamp
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes