Is there a way to build Qt in "Release with Debug info" mode ? My application crashes only in "release" mode (works fine in Debug mode) and seems the issue comes from Qt (may be a bug in Qt).So I want to see the debug info of Qt.
Qt docs has "debug" , "release" but not "release with debug" mode.
[Upate]
My application works fine with Mingw 32bit Release/Debug and VSC++ Compiler 64bit Debug.
Only crashes on VSC++ 64Bit Release
Any tips ?
Old question, I know. But nowadays, you can simply use
to get debug symbols even in release mode. When you use
QMake
via the command line, I usually do this to get a release build with debug info:this will enable below conditions of
Qt5/mkspecs/features/
default_post.prf:which would even work for
Qt 4.x
but we would need to manually append above conditions intodefault_post.prf
forQt 4.x
Looks like you need to adjust
QMAKE_CFLAGS_RELEASE
variable. In case of gcc you just need to add -g option to add debug info.We use qmake to generate vcproj files to build Qt. I wrote a python script (but sed is fine too) to change the vcproj-files to build with debug information in release too.
Having debug info is indeed invaluable for stack traces that go back and forth between Qt and our app.
Here's the relevant snippet:
May I add that in Qt 4.8, this bug seems to have been fixed. I copied those two lines into my .pro file, and it worked like a charm.
I use this in my qmake files to build my release versions with debuginfo:
This way you can at least check if the crash happens in your code. Building Qt with this mode is not supported, see this bug. You can only do it manually by changing vcproj-files or Makefiles like in the answer of Macke.
In Qt5, when calling
configure
, just simply add option-force-debug-info