Unsolved Linking against release qt in debug dll
-
Hello. I have a dll which is a plugin in other application. The application links against release qt. My debug dll(plugin) also uses qt. I can't get this combination work for some reason. If i link my dll against release qt then I have crashes then I try to use any qt function. If I link my dll against debug qt then I have a message - "qwidget: must construct a qapplication before a qpaintdevice." Does someone have a clue why it can happen? Btw, I use dynamic qt.
-
@OmegaDoom Are you on Windows?
It's impossible to mix Debug and Release libraries in one program there.
-
Yes, it's windows. I think it's possible to mix debug and release as long as we use dynamic linking.
-
I got it. It's not possible to use different configurations for qt and app because runtimes interpret memory differently when we pass object to qt and back. It workes fine only for simple types like int or char*.
-
@OmegaDoom said in Linking against release qt in debug dll:
Yes, it's windows. I think it's possible to mix debug and release as long as we use dynamic linking.
I don't think it is possible for any one given LIB, or DLL if using dynamic linking (e.g. the Qt libraries). That would mean that for a given symbol (e.g.
functionName
) there would be two available definitions --- one in the release DLL, one in the debug, DLL, and I don't see how that would work. (Depends I suppose on just exactly what "dynamic linking" means.)But anyway as you say if you're trying to pass Qt objects between release & debug versions of the libraries, that is likely never to work, if Qt has put extra stuff into them when building for debug.
-
My question was not about mixing the same library in different configurations but about let's say using release dll from other debug dll or app.
-
@OmegaDoom
You wrote:The application links against release qt. My debug dll(plugin) also uses qt.
Application uses release Qt libraries. Application uses plugin, plugin uses debug Qt libraries. That's my idea of "different versions of same libraries".
-
@JNBarchan said in Linking against release qt in debug dll:
@OmegaDoom
You wrote:The application links against release qt. My debug dll(plugin) also uses qt.
Application uses release Qt libraries. Application uses plugin, plugin uses debug Qt libraries. That's my idea of "different versions of same libraries".
You are right but It's not working anyway. If I use "debug" plugin and "release" qt then I can't pass let's say std::string to qt because its "release" runtime will interpret it incorrectly. And I can't use "debug" plugin + "debug" qt because application uses release qt. It's very unfortunate because debug version of app is extremely slow. Yes, I have debug app but it's so slow that it's impractical to use.
-
If I use "debug" plugin and "release" qt then I can't pass let's say std::string to qt because its "release" runtime will interpret it incorrectly.
Yup, that's exactly the case. Which is why we are saying you cannot mix release & debug libraries.
Which appears to leave you with:
- At release time, use release of both app & your plugin, which is fast.
- While developing, if you need to debug your plugin, use debug of both app & your plugin, and put up with it being slow when you have to debug.
-
Hi
If using visual studio compiler please check this
https://stackoverflow.com/questions/42764166/vs-2017-very-slow-laggy-when-debugging