Debugging plugins
-
Hello everyone,
So I have been several days having problems to load one of my plugins. I had several examples with simple plugins which worked fine, but one of my plugins was a bit more complex.. loading several libraries and so on. At the end I realized that i could run the windeployqt.exe on my dll and found out i was missing several Qt dlls.
My questions is, why there is no way that Qt can provide a well defined debugging system when loading plugins? Why qt did not tell me, "I'm missing these and that dll" ?
I did try many ways to have meaningful debug info:
// Set QT_DEBUG_PLUGINS programmatically #ifdef _WIN32 _putenv("QT_DEBUG_PLUGINS=1"); // Windows-specific function #else setenv("QT_DEBUG_PLUGINS", "1", 1); // Unix/Linux #endifQLoggingCategory::setFilterRules("qt.plugin.debug=true");which gave some useless information...
I am puzzled because at the end, the problem was that i was missing some Qt dlls... so why is Qt unable to warn me about that?! is there something i am missing?
Thank you for any tips!
-
Hello everyone,
So I have been several days having problems to load one of my plugins. I had several examples with simple plugins which worked fine, but one of my plugins was a bit more complex.. loading several libraries and so on. At the end I realized that i could run the windeployqt.exe on my dll and found out i was missing several Qt dlls.
My questions is, why there is no way that Qt can provide a well defined debugging system when loading plugins? Why qt did not tell me, "I'm missing these and that dll" ?
I did try many ways to have meaningful debug info:
// Set QT_DEBUG_PLUGINS programmatically #ifdef _WIN32 _putenv("QT_DEBUG_PLUGINS=1"); // Windows-specific function #else setenv("QT_DEBUG_PLUGINS", "1", 1); // Unix/Linux #endifQLoggingCategory::setFilterRules("qt.plugin.debug=true");which gave some useless information...
I am puzzled because at the end, the problem was that i was missing some Qt dlls... so why is Qt unable to warn me about that?! is there something i am missing?
Thank you for any tips!
@wasawi2 said in Debugging plugins:
so why is Qt unable to warn me about that?
I don't see how this should be possible without special handling (loading the dll, looking what dlls are imported, etc.) which is not trivial. The plugin is loaded by the os, the os simply tells Qt that it was not able to load the plugin but nothing more.
-
@Christian-Ehrlicher thank you,
Ok… that makes sense… but i still find it very unfortunate. Even if it is the OS fault… it is quite unbelievable that such a common practice is almost impossible to debug properly… i tried the famous dependency walker but it gave me tons of misdirecting errors…
I will then stick to the windeployqt.exe tool to make sure all the required dlls are in place… for now it has worked well.
But i still feel im quite blind when it comes to debugging the loading of a plugin… i thought Qt would provide advanced tools for that.
Thank you again @Christian-Ehrlicher .
-
W wasawi2 has marked this topic as solved on