如何解决这个错误“错误C2668:'abs':模糊调用重载函数” [英] How to solve this error "error C2668: 'abs': ambiguous call to overloaded function"

查看:464
本文介绍了如何解决这个错误“错误C2668:'abs':模糊调用重载函数”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

错误C2668:'abs':对重载函数的模糊调用

通过初始化变量= abs(dwSurfHeight)获取错误;

i am将visual studio 2008项目转换为视觉工作室2017.这两个版本的abs()功能有什么不同?



我尝试了什么:



尝试了abs(int(dwSurfHeight)),abs((长)(dwSurfHeight)),abs((long long)(dwSurfHeight))。然后我收到另一个错误错误LNK2026:module对SAFESEH图像不安全。我试图关闭/safesh:NO.then我得到一些符号未引用的错误。

error C2668: 'abs': ambiguous call to overloaded function
getting error by initializing a variable =abs(dwSurfHeight);
i am converting visual studio 2008 project to visual studio 2017.is the abs() function different in these two versions?

What I have tried:

tried abs(int(dwSurfHeight)),abs((long)(dwSurfHeight)),abs((long long)(dwSurfHeight)).then i am getting another error error LNK2026: module unsafe for SAFESEH image.I tried turning off /safesh:NO.then i am getting some symbol unreferenced errors.

推荐答案

dw 前缀 dwSurfHeight 变量表明它是 DWORD ,即无符号long (参见 Windows数据类型(Windows) [ ^ ] )。

为什么(新鲜的地狱)你在无符号变量上调用 abs
The dw prefix in dwSurfHeight variables indicates it is a DWORD, i.e. an unsigned long (see Windows Data Types (Windows)[^]).
Why (the fresh Hell) are you calling the abs on unsigned variable?


这篇关于如何解决这个错误“错误C2668:'abs':模糊调用重载函数”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆