std::string 관련 컴파일 에러 error C2784, error C2676


만약 아래와 같이 에러가 발생한다면 별 것 없다. string을 인클루드 안해줘서 생긴문제.

#include <string> 한줄 추가해주면 된다.

1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : 'const std::_Tree<_Traits> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(1885) : 'std::operator <' 선언을 참조하십시오.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(124) : 클래스 템플릿 멤버 함수 'bool std::less<_Ty>::operator ()(const _Ty &,const _Ty &) const'을(를) 컴파일하고 있습니다.
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\map(71) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::less<_Ty>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(451) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,_Mfl>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Kty=std::string,
1>              _Ty= ,
1>              _Pr=std::less<std::string>,
1>              _Alloc=std::allocator<std::pair<const std::string, >>,
1>              _Mfl=false
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(520) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::_Tree_nod<_Traits>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Traits=std::_Tmap_traits<std::string, ,std::less<std::string>,std::allocator<std::pair<const std::string, >>,false>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(659) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::_Tree_val<_Traits>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Traits=std::_Tmap_traits<std::string, ,std::less<std::string>,std::allocator<std::pair<const std::string, >>,false>
1>          ]
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\map(81) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::_Tree<_Traits>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Traits=std::_Tmap_traits<std::string, ,std::less<std::string>,std::allocator<std::pair<const std::string, >>,false>
1>          ]
1>          (22) : 컴파일 중인 클래스 템플릿 인스턴스화 'std::map<_Kty,_Ty>'에 대한 참조를 확인하십시오.
1>          with
1>          [
1>              _Kty=std::string,
1>              _Ty=
1>          ]
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : 'const std::_Tree<_Traits> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(1885) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : 'const std::_Tree<_Traits> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xtree(1885) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::unique_ptr<_Ty,_Dx> &,const std::unique_ptr<_Ty2,_Dx2> &)' : 'const std::unique_ptr<_Ty,_Dx> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\memory(2582) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::unique_ptr<_Ty,_Dx> &,const std::unique_ptr<_Ty2,_Dx2> &)' : 'const std::unique_ptr<_Ty,_Dx> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\memory(2582) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::unique_ptr<_Ty,_Dx> &,const std::unique_ptr<_Ty2,_Dx2> &)' : 'const std::unique_ptr<_Ty,_Dx> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\memory(2582) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : 'const std::reverse_iterator<_RanIt> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1368) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : 'const std::reverse_iterator<_RanIt> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1368) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt2> &)' : 'const std::reverse_iterator<_RanIt> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1368) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : 'const std::_Revranit<_RanIt,_Base> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1191) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : 'const std::_Revranit<_RanIt,_Base> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1191) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::_Revranit<_RanIt,_Base> &,const std::_Revranit<_RanIt2,_Base2> &)' : 'const std::_Revranit<_RanIt,_Base> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(1191) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : 'const std::pair<_Ty1,_Ty2> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(318) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : 'const std::pair<_Ty1,_Ty2> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(318) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : 'const std::pair<_Ty1,_Ty2> &'의 템플릿 인수를 'const std::string'에서 추론할 수 없습니다.
1>          c:\program files (x86)\microsoft visual studio 10.0\vc\include\utility(318) : 'std::operator <' 선언을 참조하십시오.
1>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xfunctional(125): error C2676: 이항 '<' : 'const std::string'이(가) 이 연산자를 정의하지 않거나 미리 정의된 연산자에 허용되는 형식으로의 변환을 정의하지 않습니다.
========== 빌드: 성공 0, 실패 1, 최신 0, 생략 0 ==========

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.