问题
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:
- Configuration Properties/C/C++/Optimization = Disable /Od
- Configuration Properties/C/C++/General/Debug Information Format = Program Database (/Zi)
- 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