ambiguous call to overloaded function解决的办法
来源:互联网 发布:数组tostring方法 编辑:程序博客网 时间:2024/06/06 03:18
工作中碰到这样一个问题,
程序报错:
Error 3 error C2668: 'wvsprintfW' : ambiguous call to overloaded function
这个错误的意思是:wvsprintfW有重载函数,根据目前的参数编译器无法确定调用哪个。
wvsprintfW属于系统函数,自己也没有重载过,理应不该有这样的问题,
可能是包含的头文件太多,有的文件对此函数重载过。
网上有人举例说:
int fun(int,int);
float fun(int,int); //编译器就会出现错误 不知道到底调用哪个函数
这里的错误可能不是上述类型的,但这个例子可以帮助理解。
最终解决方法是:在调用的wvsprintfW前加” :: “符号,指明采用全局函数,这样编译器就不需做选择了。
转载自:http://blog.163.com/jiaqiang_wang/blog/static/11889615320095294331497/
我出错的代码:
// rs.GetODBCFieldInfo(0,fi); //得带数据库中bookinfo表中的各个字段名。 ---这句代码出错
// m_report_c.InsertColumn(0,fi.m_strName,LVCFMT_LEFT,100); //插入
// rs.GetODBCFieldInfo(1,fi); //得带数据库中bookinfo表中的各个字段名。
// m_report_c.InsertColumn(1,fi.m_strName,LVCFMT_LEFT,100); //插入
修改后:
for(short j=0;j<2;j++)
{
rs.GetODBCFieldInfo(j,fi); //得带数据库中bookinfo表中的各个字段名。
m_report_c.InsertColumn(j,fi.m_strName,LVCFMT_LEFT,100); //插入
}
- ambiguous call to overloaded function解决的办法
- ambiguous call to overloaded function
- 'sqtr'ambiguous call to overloaded function
- error C2668: 'abs' : ambiguous call to overloaded function
- C2668: 'sqrt' : ambiguous call to overloaded function(sqrt问题)
- 【关于DrawLine' : ambiguous call to overloaded function解决办法】
- error C2668: ‘pow’ : ambiguous call to overloaded function
- error C2668: ‘sqrt’ : ambiguous call to overloaded function
- ambiguous call to overloaded function 两种情况的错误分析及解决方法
- error C2668: 'sqrt' : ambiguous call to overloaded
- 关于sqrt函数 error C2668: 'sqrt' : ambiguous call to overloaded function
- 关于sqrt函数 error C2668: 'sqrt' : ambiguous call to overloaded function
- call of overloaded 'round(&float)' is ambiguous
- 解决Call to undefined function
- call of overloaded 'max(char&, char&)' is ambiguous
- call of overloaded `pow(int, int)' is ambiguous;
- C++: 解释error: call of overloaded ‘abs(int)’ is ambiguous
- Bug-List: call of overloaded 'sqrt(u16&)' is ambiguous
- Windows CE下的USB设备驱动程序开发实例(一)
- statspack安装使用 和 report 分析
- UVA 11995 - I Can Guess the Data Structure! (数据结构) STL的应用
- VI编辑器的快捷键
- Windows CE下的USB设备驱动程序开发实例(二)
- ambiguous call to overloaded function解决的办法
- JavaScript保留指定的小数位
- 用户 'IIS APPPOOL\DefaultAppPool' 登录失败。
- 如何使用github
- MySQL中文乱码问题解决
- stevens
- S3c2440A 平台HIVE 注册表+binfs 的实现
- android中文件简单下载
- 数学学习小记(二) 组合数求模:Lucas 定理 LightOJ 1067 + Hdu 3037