Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
3.1.0 (rev.02)
-
None
-
Windows 10
-
-
f3b0145ec (dev), eba0f6484 (dev), bfac24d89 (dev), dc6093b2b (dev)
Description
I have Qt compiled static, when I try to compile my application I get link errors about the particles plugin.
I'm compiling using Visual Studio 2022 and Qt 6.6.0.
Follow a reproducible example:
#include <QtWidgets> #include <QQuickWidget> #include <QGridLayout> int main(int argc, char *argv[]) { QApplication a(argc, argv); QWidget w; QGridLayout* gridLayout = new QGridLayout(&w); QQuickWidget* view = new QQuickWidget(&w); view->setSource(QUrl("qrc:/particles.qml")); view->setResizeMode(QQuickWidget::SizeRootObjectToView); gridLayout->addWidget(view, 0, 0); w.resize(620, 300); w.show(); return a.exec(); }
particles.qml
import QtQuick 2.5 import QtQuick.Particles 2.0 Rectangle { id : root color: 'black' ParticleSystem { id: system } ImageParticle { system : system source : 'qrc:/snow.png' color : 'red' } Emitter { anchors.fill : root system : system size : 32 } }
1>Build FAILED. 1> 1>particlesplugin.lib(particlesplugin_QtQuick2ParticlesPlugin.cpp.obj) : error LNK2019: unresolved external symbol "void __cdecl qml_register_types_QtQuick_Particles(void)" (?qml_register_types_QtQuick_Particles@@YAXXZ) referenced in function "public: static __cdecl `public: static void (__cdecl*__cdecl QtPrivate::QMetaTypeForType<class QtQuick2ParticlesPlugin>::getDefaultCtr(void))(class QtPrivate::QMetaTypeInterface const *,void *)'::`5'::<lambda_1>::<lambda_invoker_cdecl>(class QtPrivate::QMetaTypeInterface const *,void *)" (?<lambda_invoker_cdecl>@<lambda_1>@?4??getDefaultCtr@?$QMetaTypeForType@VQtQuick2ParticlesPlugin@@@QtPrivate@@SAP6AXPEBVQMetaTypeInterface@4@PEAX@ZXZ@SA@01@Z) 1>C:\Users\QML\x64\Release\QML.exe : fatal error LNK1120: 1 unresolved externals 1> 0 Warning(s) 1> 2 Error(s)
Follow a Visual Studio sample project QML.zip
Attachments
For Gerrit Dashboard: QTVSADDINBUG-1173 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
581695,8 | Fix linking of QML plugin dependencies in static builds | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |
603692,4 | Fix QML plugins not working with the static build | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |
604405,2 | Add auto-test for static QML plugin | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |
604406,3 | Fix QML static plugin not added to build | dev | qt-labs/vstools | Status: MERGED | +2 | 0 |