How does QT generate pdb files under Release compilation

Method one, change the configuration file

Directory: Qt5.13.2\5.13.2\msvc2017_64\mkspecs\common
File: msvc-desktop.conf

QMAKE_CFLAGS_RELEASE    = -O2 -MD -Zi
QMAKE_LFLAGS_RELEASE    = /INCREMENTAL:NO /DEBUG

About -Zi

Generate a program database (PDB), which contains type information and symbolic debugging information for the debugger.

About -O2

Optimize speed.

About-MD

Multithreaded DLL.

Method two, change the project settings pro file

Add the following code in the pro file

QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

At last

Choose one of the above two methods to generate the pdb file.

Guess you like

Origin blog.csdn.net/weixin_38293850/article/details/109628252