I am trying to implement plugin system for my project. I am using Qt 5.15 and static Qt libraries. I have a plugin dll that implements my custom interface. I am using QLibrary to load dll library without any problem. However, while I am trying to create QWidget in dll, it says “QWidget: Must construct a QApplication before a QWidget”. I could not find any solution. Can you help me?
Asked
Active
Viewed 35 times
0
-
The error is pretty clear: you "Must construct a QApplication before a QWidget". Have you did that? – Osyotr Aug 03 '22 at 20:54
-
Yes, I have a QApplication. Inside this application, I am calling dll. After I call dll function, this problem occurs. I think QApplication is not passed to dll functions. – Doğukan Fikri Arat Aug 05 '22 at 05:34
-
https://doc.qt.io/qt-5/plugins-howto.html#static-plugins Basically, you need to either build your plugins statically, or build Qt dynamically – Osyotr Aug 05 '22 at 11:07