qmake: How to force use of release Qt libraries in debug build?
-
For testing purposes, I'd like to make a debug build of my application, but have it use the release version of all or selected Qt libraries.
How can I do that in qmake?LIBS variable does not contain the Qt libs, so I cannot override there. I suspect there is an automatism based on CONFIG, but I would expect there to be an override...?
-
@Asperamanca you could try the profile build, which is release with additional debug info.
Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).
Regards
-
@aha_1980 said in [qmake: How to force use of release Qt libraries in debug build?]
Mixing debug program and release libraries or other way round is not possible at least on Windows (different compiler runtimes).
Well, it is possible if you don't use qmake :-)
Thanks for verifying my suspicion. I suspect the quick hack would be to automatically adapt the generated makefile before running the make step. -
@Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:
Well, it is possible if you don't use qmake :-)
Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.
-
@jsulm said in qmake: How to force use of release Qt libraries in debug build?:
@Asperamanca said in qmake: How to force use of release Qt libraries in debug build?:
Well, it is possible if you don't use qmake :-)
Not on Windows. I mean you can build, yes, but: usually your app will crash if you mix debug and release libraries.
Interesting. I tried using Visual Studio, and had no issues. I mean, I don't even have debug versions of some 3rd party libraries, how could I ever use a debug build?
-
@Asperamanca I'm not sure about other libraries (pure C libs should not be an issue), but mixing debug/release Qt libs often leads to crashes. You can find threads in forums here where exactly this happens.
-
Link for interested readers: https://stackoverflow.com/questions/11658915/mixing-debug-and-release-library-binary-bad-practice