cppunit을 사용하여 qt 프로젝트를 테스트하려고합니다. 테스트 프로젝트는 MFC를 사용합니다. Visual Studio 2010을 사용 중입니다.qt 헤더 파일에서 컴파일 오류가 발생했습니다.
전 테스트 할 cpp 파일을 컴파일하기 위해 전 처리기 정의를 추가하는 등 프로젝트 설정에 qt 라이브러리, dll을 포함하고 다른 변경 사항을 포함 시켰습니다. 나는이 CPP 파일을 컴파일 할 때, 나는 Qt는 헤더 files..The 컴파일 출력에있는 구문 오류, 많은이 아래에 주어진다 얻을 :
이1>------ Build started: Project: my_tests, Configuration: Debug Win32 ------
1>cl : Command line warning D9025: overriding '/ZI' with '/Zi'
1>cl : Command line warning D9025: overriding '/GS' with '/GS-'
1>cl : Command line warning D9025: overriding '/Zc:wchar_t' with '/Zc:wchar_t-'
1> CSetting.cpp
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qiodevice.h(247): error C2143: syntax error : missing ')' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qiodevice.h(247): error C2143: syntax error : missing ';' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qiodevice.h(247): error C2805: binary 'operator <<' has too few parameters
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qiodevice.h(247): error C2059: syntax error : ')'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2143: syntax error : missing ')' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2143: syntax error : missing ';' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2805: binary 'operator <<' has too few parameters
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2988: unrecognizable template declaration/definition
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2059: syntax error : 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2065: 'T' : undeclared identifier
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(160): error C2059: syntax error : ')'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(178): error C2065: 'T' : undeclared identifier
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(180): error C2143: syntax error : missing ';' before '{'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(180): error C2447: '{' : missing function header (old-style formal list?)
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(190): error C2143: syntax error : missing ')' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(190): error C2143: syntax error : missing ';' before 'constant'
1>c:\qt\4.8.2\include\qtcore\../../src/corelib/io/qdebug.h(190): fatal error C1903: unable to recover from previous error(s); stopping compilation
이러한 오류 제발 도와주세요 ..
합니다. 모든 세미콜론과 대괄호가 제자리에 있습니다 .. – Hariprasad
Qt 헤더 파일을 포함하기 전에 모든 cpp 파일에 StdAfx.h를 포함하고 있습니다 ... 문제의 원인이 무엇입니까 ..? 그런 경우 해결책이 될 수 있습니까? 다른 헤더 파일보다 먼저 StdAfx.h를 포함해야하기 때문에, 맞습니까? – Hariprasad
흠 Qt include를 제거하고 다른 오류가 있는지 확인하십시오 (물론 "unknown symbol"을 제외하고) –