当我这样做时:
std::string name = targetBone->getName();
if(name == "Pelvis")
{
return;
}
我明白了:
Error 1 error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::string' (or there is no acceptable conversion)
如何解决此错误?
由于
答案 0 :(得分:6)
您是否在cpp文件中包含了字符串
#include <string>
这通常是因为编译器需要查看驻留在该包含文件中的字符串类的定义,以验证它确实声明了一个带有 char * 的运算符
答案 1 :(得分:0)