2013-10-24 3 views
7

문제점 : CONFIG (디버그 | 디버그) 및 CONFIG (릴리스, deubg | 릴리스)는 Qt Creator 2.8.1에서 선택된 디버그 또는 릴리스가있는 곳에서 항상 평가됩니다. 리눅스.Qt Creator Qt Creator CONFIG (디버그, 릴리스) 스위치가 작동하지 않습니다.

Qt는 창조주 응용 프로그램 (주 - 새 프로젝트에 대한 기본)의 내 구성 :

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 

여전히 디버그를보고 구성을 해제 심지어 내가 completly 깨끗한 CONFIG 변수합니다.

무엇이 잘못 되었나요?

+0

릴리스의 경우 'qmake CONFIG- = Debug'를 실행하고 디버그의 경우 'qmake CONFIG- = Release'를 실행하십시오. – dvvrd

+0

첫 번째 코드 인용에서 알 수 있듯이 이렇게합니다. – killdaclick

+0

아니요. 나는 CONFIG + = debug가 아닌 CONFIG = debug를 보았습니다. – dvvrd

답변

18

Qmake가 제 정신이 아니므로 가능한 유일한 설명입니다. 여러 번 설정에서 전체 릴리즈/디버그가 늦어지기 전에 해결되지 않은 오래된 설계 버그와 같은 냄새가 나고 너무 많은 구성이 이미 작성되었습니다. make의 탭을 기억 하시겠습니까? Dude는 15 명의 사용자와 같았으므로 나쁜 결정을 결코 수정하지 않았습니다.

어쨌든.

Linux의 Qt 4.8.4.1에서 같은 문제가 발생합니다.

해결책은 다음과 같습니다. 줄 바꿈을 제거한 다음 줄 바꿈을 제거하십시오.

말 그대로,이 작품 :

CONFIG(release, debug|release) { 
    message(Release) 
} 

CONFIG(debug, debug|release) { 
    message(Debug) 
} 

를이하지 않는 동안 :

CONFIG(release, debug|release) 
{ 
    message(Release) 
} 

CONFIG(debug, debug|release) 
{ 
    message(Debug) 
} 

나는 이것이 가능 리눅스 측면에서만, qmake를 몇 가지 버전의 구문 분석 버그 생각한다.

+1

감사합니다! 이 버그는 Windows에도 있습니다. –

+1

Windows의 Qt 5.3.1, Qt Creator 3.1.2의 문제 –

+0

Qt 5.6을 해당 목록에 추가 ... -______- –