Qt Creator creates both a debug and a release folder inside the designated debug folder

别等时光非礼了梦想. 提交于 2019-12-20 20:24:47

问题


I am using the default build directory in Qt Creator which is something like build-project-blah-blah-Debug. However, when I build my app in debug mode both a debug and and a release folder are created inside. If I set the build directory as build-project-blah-blah for both the debug and release builds Qt Creator does not behave properly, i.e. it complaints and it does not clean the built files.


回答1:


I deduced the solution from this answer to the reverse question. In your .pro file, add the following line to prevent the subdirectories being created:

CONFIG -= debug_and_release debug_and_release_target

This issue only occurs on Windows, not on Unix-based OS's. Windows sets these flags by default, whereas Unix implementations of QT don't. To me it was mainly a problem due to compatibility of my project between both environments.




回答2:


You can choose folder for debug and release builds on the projects mode (Ctrl + 5)

There you have a combo box which says "Edit build configuration", and lets you choose Release or Debug, and then you can edit the build directory of each one



来源:https://stackoverflow.com/questions/28993418/qt-creator-creates-both-a-debug-and-a-release-folder-inside-the-designated-debug

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