업데이트 : catch 1.9.7을 사용하면이 문제가 해결됩니다.Visual Studio 2008에서 catch를 컴파일 할 때 오류가 발생했습니다.
나는 그냥 잡기를 사용하는 것으로 시작하고 있으며, 컴파일하는 간단한 테스트 프로젝트조차도 얻을 수 없었다. Visual Studio 2008을 사용하고 catch.hpp v1.10.0 (단일 파일 버전)을 사용하고 있습니다.
나는 catch 튜토리얼에 따라 간단한 테스트 프로젝트를 만들었습니다. MAIN.CPP이 유일한 파일과 코드는 다음과 같이 구성
c:\utilities\catch\catchtest\catchtest\catch.hpp(1333) : warning C4181: qualifier applied to reference type; ignored
c:\utilities\catch\catchtest\catchtest\catch.hpp(1838) : see reference to class template instantiation 'Catch::Internal::Evaluator<T1,T2,Op>' being compiled
with
[
T1=const int &,
T2=const int &,
Op=IsEqualTo
]
c:\utilities\catch\catchtest\catchtest\catch.hpp(1836) : while compiling class template member function 'void Catch::BinaryExpression<LhsT,Op,RhsT>::endExpression(void) const'
with
[
LhsT=const int &,
Op=IsEqualTo,
RhsT=const int &
]
c:\utilities\catch\catchtest\catchtest\main.cpp(8) : see reference to class template instantiation 'Catch::BinaryExpression<LhsT,Op,RhsT>' being compiled
with
[
LhsT=const int &,
Op=IsEqualTo,
RhsT=const int &
]
c:\utilities\catch\catchtest\catchtest\catch.hpp(1333) : error C2529: 'lhs' : reference to reference is illegal
c:\utilities\catch\catchtest\catchtest\catch.hpp(1333) : warning C4181: qualifier applied to reference type; ignored
c:\utilities\catch\catchtest\catchtest\catch.hpp(1333) : error C2529: 'rhs' : reference to reference is illegal
c:\utilities\catch\catchtest\catchtest\catch.hpp(1838) : error C2664: 'Catch::Internal::Evaluator<T1,T2,Op>::evaluate' : cannot convert parameter 1 from 'const int' to 'const int &(&)'
with
[
T1=const int &,
T2=const int &,
Op=IsEqualTo
]
c:\utilities\catch\catchtest\catchtest\catch.hpp(1839) : error C2228: left of '.endExpression' must have class/struct/union
어떤 도움이 많이 주시면 감사하겠습니다 :
#define CATCH_CONFIG_MAIN
#include "catch.hpp"
TEST_CASE("test case 1")
{
REQUIRE(1==2);
}
내가 컴파일 할 때 나는 다음과 같은 오류를 얻을. 나는 캐치 문서 또는 온라인에서 무엇이든을 찾을 수없고 그것을 시작하기 위하여 열망한다.
행운은 있지만 여전히 같은 오류가 있습니다. – JMayer