問題:無論Qt Creator 2.8.1中選擇了調試還是發佈,CONFIG(debug,debug | release)和CONFIG(release,deubg | release) Linux操作系統。Qt Creator CONFIG(調試,釋放)開關不起作用
我的Qt Creator中的應用(股票 - 默認爲新項目)的配置:
Projects->Build Settings->Debug Build Steps:
qmake build configuration: Debug
Effective qmake call: qmake2 proj.pro -r -spec linux-gnueabi-oe-g++ CONFIG+=debug
Projects->Build Settings->Release Build Steps:
qmake build configuration: Release
Effective qmake call: qmake2 proj.pro -r -spec linux-gnueabi-oe-g++
我在proj.pro配置:在控制檯上
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Debug build)
}
CONFIG(release,debug|release)
{
message(Release build)
}
輸出,用於調試:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: lex yacc warn_on debug uic resources warn_on release incremental link_prl no_mocdepend release stl qt_no_framework debug console
Project MESSAGE: Debug build
Project MESSAGE: Release build
發佈在控制檯上的輸出:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: lex yacc warn_on uic resources warn_on release incremental link_prl no_mocdepend release stl qt_no_framework console
Project MESSAGE: Debug build
Project MESSAGE: Release build
在Windows 7下我沒有遇到過這樣的.pro配置的任何問題,它工作正常。 我絕望和修改.pro文件:
CONFIG = test
message(Variable CONFIG:)
message($$CONFIG)
CONFIG(debug,debug|release)
{
message(Debug build)
}
CONFIG(release,debug|release)
{
message(Release build)
}
,我與輸出驚訝:
Project MESSAGE: Variable CONFIG:
Project MESSAGE: test
Project MESSAGE: Debug build
Project MESSAGE: Release build
所以,即使我完全地乾淨的CONFIG變量仍見調試和發佈配置。
我在做什麼錯?
也許試着運行'qmake CONFIG- = Debug'進行發佈,'qmake CONFIG- = Release'進行調試 – dvvrd
正如你在第一個代碼引用中看到的那樣。 – killdaclick
不,我不會。我看到'CONFIG + = debug',而不是'CONFIG- = debug' – dvvrd