1、error C2275: “XXX”: 将此类型用作表达式非法
在移植c++代码到c
解决的办法就是把变量
2、error C2780: “const _Ty &std::min(const _Ty &,const _Ty &,_Pr)” : 应输入 3 个参数,却提供了 2 个
error C2780: “const _Ty &std::min(const _Ty &,const _Ty &,_Pr)” : 应输入 3 个参数,却提供了 2 个
/include/xutility(1265) : 参见“std::min”的声明
error C2782: “const _Ty &std::min(const _Ty &,const _Ty &)” : 模板参数“_Ty”不明确
/include/xutility(1257) : 参见“std::min”的声明
原因: std::min(a, b) 其中 a 和 b 的变量类型不相同。
3、error C2533 “CXXX{ctor}” 构造函数不能有返回类型
原因:头文件类声明结尾没加分号(;)
class CInitSock
{
public:
CInitSock(BYTE,BYTE);
virtual ~CInitSock();
} ;
将int x = max(i,j);
改成
int x = (std::max<int>)(i,j);
5、VS2010中error C2780: const _Ty &std::max(const _Ty &,const _Ty &,_Pr)
将int x = max(i,j);
改成
int x = (std::max<int>)(i,j);
转载于 http://blog.youkuaiyun.com/wuxiaoyao12?viewmode=contents