MS Visual Studio 2005의 Windows에서 Openipmp 클라이언트를 실행 중입니다. 문서에 따르면 Visual Studio 6에서만 테스트되었지만 MS Visual Studio .NET. 내가 DRMPlugin를 컴파일하고 때은 'const char *'에서 'std :: _ String_const_iterator'로 변환 할 수 없습니다.
, 하나의 코드는 다음 오류를
error C2440: '<function-style-cast>' : cannot convert from 'const char *'
to 'std::_String_const_iterator<_Elem,_Traits,_Alloc>'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Alloc=std::allocator<char>
]
No constructor could take the source type, or constructor overload resolution was ambiguous
을주는 것은 누군가가 코드에 어떤 문제가 있는지 말해 줄 수 코드
bool OpenIPMPDOIContentInfoManager::ParseHostIPPort(const std::string& hostURL,
std::string& hostIP, int& hostPort) {
const char* colon = strchr(hostURL.data(), ':');
if (colon == NULL) {
return false;
}
hostIP = std::string(hostURL.begin(), std::string::const_iterator(colon));
hostPort = atoi(++colon);
return true;
}
에게 있습니다.
도와주세요.
텍스트 블록을 코드로 표시하려면 텍스트 블록을 선택하고 {} 기호 (또는 Ctrl-K)를 눌러 버튼을 누릅니다. 코드 (및 가능한 오류)를 코드로 표시하면 읽기가 쉬워집니다. –
David 님의 제안에 감사드립니다. 나는 명심할 것이다 :). –