QMAKE *.pro-file: enable debugging info in release

2019-07-28 21:04发布

because of compatibility issues, I compile my project in VS2008 in release mode, but I need to access debug information. That is why I manually set up debugging settings in project properties for release mode. In VS2008, I open Properties window and select:

  1. Configuration Properties/C/C++/Optimization = Disable /Od
  2. Configuration Properties/C/C++/General/Debug Information Format = Program Database (/Zi)
  3. Configuration Properties/C/C++/Linker/Generate Debug Info = Yes (/DEBUG)

I use a pro-file to configure my project's vcproj-file. Every time I alter this pro-file, I have to reload my project and the the debug settings are lost. I want to include three settings mentioned above into the pro-file, so that after changing it, I do not need to set up debugging settings again.

I have already googled and I have also looked my question up in QT reference, but I could not find anything. I will be happy to receive any suggestion!

1条回答
▲ chillily
2楼-- · 2019-07-28 21:44

OK guys, I have figured it out.

In the QMAKE file myproject.pro, insert following commands:

QMAKE_CXXFLAGS_RELEASE += /Zi 
QMAKE_CXXFLAGS_RELEASE += /Od
QMAKE_LFLAGS_RELEASE += /DEBUG

This should work!

查看更多
登录 后发表回答