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

流过昼夜 提交于 2019-12-11 07:53:56

问题


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:


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!



来源:https://stackoverflow.com/questions/9127011/qmake-pro-file-enable-debugging-info-in-release-mode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!