vs2005转换到vs2012嵌入汇编出现如下错误error C2244
2017-03-28 13:09
204 查看
问题
1>------ 已启动生成: 项目: sage_capture_final, 配置: Debug Win32 ------
1> sage_capture_final_Part.cpp
1>sage_capture_final_Part.cpp(1871): error C2244: “std::end”: 无法将函数定义与现有的声明匹配
1>sage_capture_final_Part.cpp(1871): error C2415: 不正确的操作数类型
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
代码
int GetSystemBit()
{
int i=0;
int x=0;
double a=0;
__asm //将-1 连续左移直到为 0
{
mov eax,-1; //将-1赋值给eax
start:
cmp eax,0; //判断 eax - 0 ?= 0
je end; //以上两个值相等则跳转end
shl eax,1; //左移一位
mov ecx,i; //将i赋值给ecx
inc ecx; //将ecx增加1
mov i,ecx; //将ecx赋值给i
jmp start; //跳转到 start
end:
mov x,eax;
}
return i;
}
解决方法
重命名end即可,如下列代码所示
int GetSystemBit()
{
int i=0;
int x=0;
double a=0;
__asm //将-1 连续左移直到为 0
{
mov eax,-1; //将-1赋值给eax
start:
cmp eax,0; //判断 eax - 0 ?= 0
je end2; //以上两个值相等则跳转end
shl eax,1; //左移一位
mov ecx,i; //将i赋值给ecx
inc ecx; //将ecx增加1
mov i,ecx; //将ecx赋值给i
jmp start; //跳转到 start
end2:
mov x,eax;
}
return i;
}
1>------ 已启动生成: 项目: sage_capture_final, 配置: Debug Win32 ------
1> sage_capture_final_Part.cpp
1>sage_capture_final_Part.cpp(1871): error C2244: “std::end”: 无法将函数定义与现有的声明匹配
1>sage_capture_final_Part.cpp(1871): error C2415: 不正确的操作数类型
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========
代码
int GetSystemBit()
{
int i=0;
int x=0;
double a=0;
__asm //将-1 连续左移直到为 0
{
mov eax,-1; //将-1赋值给eax
start:
cmp eax,0; //判断 eax - 0 ?= 0
je end; //以上两个值相等则跳转end
shl eax,1; //左移一位
mov ecx,i; //将i赋值给ecx
inc ecx; //将ecx增加1
mov i,ecx; //将ecx赋值给i
jmp start; //跳转到 start
end:
mov x,eax;
}
return i;
}
解决方法
重命名end即可,如下列代码所示
int GetSystemBit()
{
int i=0;
int x=0;
double a=0;
__asm //将-1 连续左移直到为 0
{
mov eax,-1; //将-1赋值给eax
start:
cmp eax,0; //判断 eax - 0 ?= 0
je end2; //以上两个值相等则跳转end
shl eax,1; //左移一位
mov ecx,i; //将i赋值给ecx
inc ecx; //将ecx增加1
mov i,ecx; //将ecx赋值给i
jmp start; //跳转到 start
end2:
mov x,eax;
}
return i;
}
相关文章推荐
- AT&T汇编出现如下错误时解决方案
- 用FileStream上传图片转换成二进制,在本地用行,传到服务器上去出现如下错误
- VS2010出现如下链接错误:LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- VC编译出现如下错误:错误 1 error C2664: “wsprintfW”: 不能将参数 2 从“const char [6]”转换为“LPCWSTR” e:\c_2008\pra6\pra6\
- vs中由低版本转换为高版本出现如下错误的解决办法
- SSH整合出现如下错误`Class_$$_javassist_0`代理类不能转换成 `javassist. util. proxy. Proxy`类型
- VS2005(VC6)出现如下链接错误的解决方法uafxcwd.lib(afxmem.obj) : error LNK2005: "void * __cdecl operator new(unsign
- 用FileStream上传图片转换成二进制,在本地用行,传到服务器上去出现如下错误
- Sql2000、Sql2005共存时,出现”VS2005建立连接不成功错误“的解决方法
- VS2005 调试时出现“无法附加。绑定句柄无效”错误的解决办法.
- Eclipse中出现数据类型转换错误的解决办法
- 在应用ERP PATCH的时候,可能出现一些错误,可以通过如下log文件查看错误
- 装vs2005 sp1出现数字签名错误的解决办法
- 安装vs2005 sp1 出现错误 1718。文件被数字签名策略拒绝
- 解决VS2005在验证XHTML时"body"不允许出现文本的错误
- 存储过程传递参数时出现类型转换错误!如:varchar转换为int时出错
- 用vs2005 Coding时出现错误Inconsistent accessibility
- 在原有VS2005基础上安2008测试版本2以后出现:配置节错误:web.config/protocols 解决方法。
- vs2005启动调试程序时,出现 无法附加,绑定句柄无效 的错误
- 如运行程序时出现 "Error establishing socket" 错误,则应进行如下调试: