Jon
Jon

Reputation: 4055

Qt debug with release

I am trying to debug a program I made with Qt 4.7.3 in Release mode. I would like to debug into this program. Is there a way to build the Qt DLL libraries in release with debug info?

I'm on Windows using Visual Studios 2008.

Upvotes: 0

Views: 2486

Answers (1)

John
John

Reputation: 236

To generate debug symbols for your release build of Qt on windows...

  1. Add the flag "-Zi" to QMAKE_CFLAGS_RELEASE in your qmake.conf.
  2. Add the flag "/DEBUG" to QMAKE_LFLAGS_RELEASE in your qmake.conf (you'll probably also want "/OPT:REF" and "/OPT:icf")

For a VC2008 build you would add this to Qt\mkspecs\win32-msvc2008\qmake.conf Then configure and rebuild.

More details of the various qmake options available here: http://doc.qt.io/qt-5/qmake-variable-reference.html

Upvotes: 2

Related Questions