Qt Creator在指定的调试文件夹内创建调试文件夹和发布文件夹 [英] Qt Creator creates both a debug and a release folder inside the designated debug folder

查看:486
本文介绍了Qt Creator在指定的调试文件夹内创建调试文件夹和发布文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Qt Creator中的默认构建目录,该目录类似于 build-project-blah-blah-Debug 。但是,当我在调试模式下构建应用程序时,会同时在其中创建 debug release 文件夹。如果我同时将调试和发布版本的构建目录都设置为 build-project-blah-blah ,则Qt Creator将无法正常运行,即会抱怨并且不会清除生成的文件。

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.

推荐答案

我从得出以下答案相反的问题
在.pro文件中,添加以下行以防止创建子目录:

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

此问题仅出现在Windows上,而不出现在基于Unix的操作系统上。 Windows默认设置这些标志,而QT的Unix实现则没有。对我来说,这主要是由于我的项目在两种环境之间的兼容性而引起的问题。

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.

这篇关于Qt Creator在指定的调试文件夹内创建调试文件夹和发布文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆