Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
6.5.1
-
None
Description
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
Attachments
Issue Links
- duplicates
-
QTBUG-110243 Resources are lost when linking static libraries using CMake build system in a separate project
- Closed