2010-04-22 3 views
4

Visual Studio 2005 및 Visual Studio 2008의 경고 수준 4와 함께 정상적으로 컴파일되는 응용 프로그램을 다시 컴파일하려고합니다. 오류 (아래 참조)가 std : tr1에서 발생하므로 충돌이 발생한다고 생각하지만 고칠 방법을 모르겠다. 내 첫 번째 생각은 부스트에 대한 모든 참조를 제거하는 것이었지만 그런 다음 형식 메서드를 찾을 수 없다는 오류가 발생합니다. 여기 오류 중 하나가 있습니다. (의미가 확실하지 않습니다) 아이디어, 제안 사항, 해결책이 있습니까? 감사합니다.Visual Studio 2010에서 왜 Boost 1.42.0에서이 오류가 발생합니까?

편집 : 나는 메시지가 표시 오른쪽 시작 부분에 : 알 수없는 컴파일러 버전 - 구성 테스트를 실행하고 결과를보고하시기 바랍니다

EDIT2 : 나는 원인이 오류를 생각하는 코드의 조각 : (무고한을 보호하기 위해 변경) EDIT3 : 오류 메시지를 업데이트했습니다. 즉, more ...를 추가했는데 더 많은 오류 메시지가 표시됩니다. 더 큰 문제/문제가 있습니다.

!m_someMap.insert(std::make_pair("somestring", SomeClass::isTrue)).second 
.... 
..... 
inline bool isTrue (const IDog & dog) { return s.IsDogTrue(); } 



1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list 
1>   with 
1>   [ 
1>    _Ty=bool (__cdecl &)(const IDog &) 
1>   ] 
1>   c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(356): could be 'std::tr1::_Remove_reference<_Ty&&>' 
1>   c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtr1common(350): or  'std::tr1::_Remove_reference<_Ty&>' 
1>   c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(962) : see reference to class template instantiation 'std::tr1::remove_reference<_Ty>' being compiled 
1>   with 
1>   [ 
1>    _Ty=bool (__cdecl &)(const IDog &) 
1>   ] 
1>   c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(26) : see reference to class template instantiation 'std::tr1::decay<_Ty>' being compiled 
1>   with 
1>   [ 
1>    _Ty=bool (__cdecl &)(const IDog &) 
1>   ] 
1>   C:\(PATH)\...(915) : see reference to class template instantiation 'std::tr1::_Unrefwrap<_Type>' being compiled 
1>   with 
1>   [ 
1>    _Type=bool (__cdecl &)(const IDog &) 
1>   ] 
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(965): error C2528: 'abstract declarator' : pointer to reference is illegal 
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(349): error C2528: 'type' : pointer to reference is illegal 
1>   c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(967) : see reference to class template instantiation 'std::tr1::add_pointer<_Ty>' being compiled 
1>   with 
1>   [ 
1>    _Ty=bool (__cdecl &)(const IDog &) 
1>   ] 
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\type_traits(197): error C2752: 'std::tr1::_Remove_reference<_Ty>' : more than one partial specialization matches the template argument list 
1>   with 
1>   [ 
1>    _Ty=bool (__cdecl &)(const char *,int,const char *,std::string &) 
1>   ] 
+3

템플릿 인스턴스화에서 모든 오류가 발생합니다. Boost를 호출하기 위해이 코드를 진단해야합니다. –

+0

비주얼 스튜디오 10에서 부스트를 빌드해야한다고 생각합니다. – ra170

+2

@ ra170 : 아니요, 컴파일 중에 오류가 발생했습니다. 빌드가 부족하면 링크 시간 오류가 발생합니다. –

답변

8

Visual Studio 2010에서 문제가 발생했거나 Visual Studio 2010 tr1에 추가 된 추가 템플릿으로 인해 std :: make_pair가 항상 작동하지 않는다고 말해야합니다. 는 <> 쌍으로 변경되었으며 모든 오류가 마술처럼 사라졌습니다.

VC2010에 템플릿 문제가 있고 std : make_pair를 사용하는 경우 템플릿을 <> 쌍으로 변경하고 템플릿 매개 변수를 지정하십시오.

-5

Visual Studio에서 사용자가 모르는 뭔가를하고있는 것 같습니다. 제 생각에는 당신은 code::blocks IDE와 함께 Microsoft 컴파일러를 사용할 수 있다고 생각합니다. 각 컴파일러를 시험해 볼 수 있습니다 (VS 2005/2008/2010). 또한 소스 코드 저장소에서 diff를 시도하여 Microsoft가 코드를 "우회"하지 않았는지 확인하십시오.

참고 : 문제를 파악한 후에 Code :: Blocks를 사용할 필요가 없습니다. 이 문제에 대한 좋은 도구 일 수 있습니다.

+2

-1 : OP 질문에 대답하지 않습니다. 또한 IDE가 아니라 컴파일러에서 오류가 발생하여 메시지가 변경되지 않습니다. 코드 : : 블록 편집 : Visual Studio 코드 "prettify"않습니다. 그것은 경우에도 여전히 컴파일해야합니다. –

+1

+1 : 적어도 그는 문제의 원인으로 간주 될 수 있습니다 무엇을 지적했다 – chester89

+0

@ chester89 : "Visual Studio를 사용하지 마십시오"라는 유일한 조언은 무엇입니까? –

관련 문제