ambiguous call to overloaded function错误分析及解决方法
2011-12-20 22:47
1241 查看
Background
在VS2005环境中,开发基于MFC的程序,编译的时候出现如下的情况错误信息:Error 3 error C2668: 'wvsprintfW' : ambiguous call to overloaded function
Analysis
这个错误的意思是:wvsprintfW有重载函数,根据目前的参数编译器无法确定调用哪个函数。wvsprintfW属于系统函数,自己也没有重载过,理应不该有这样的问题,可能是包含的头文件太多,有的文件对此函数重载过。
网上有人举例说:
int fun(int,int);
float fun(int,int); //编译器就会出现错误 不知道到底调用哪个函数
这里的错误可能不是上述类型的,但这个例子可以帮助理解。
最终解决方法是:在调用的wvsprintfW前加” :: “符号,指明采用全局函数,这样编译器就不需做选择了。
注:
ambiguous [æm'bigjuəs]
adj.模棱两可的, 含糊不清的
His analysis of the problem showed great perception
相关文章推荐
- ambiguous call to overloaded function 两种情况的错误分析及解决方法
- 出现Fatal error: Call to undefined function mysql_connect()错误的解决方法
- Fatal error: Call to a member function read() on a non-object in 错误解决方法
- Call to undefined function curl_init()错误解决方法
- 开发新浪微博应用出现以下问题Fatal error:Call to undefined function curl_init() in错误的解决方法
- DEDE发生Fatal error: Call to a member function read() on a non-object in 错误解决方法
- Fatal error: Call to a member function read() on a non-object in 错误解决方法
- ADS 转Keil, ADS升级至MDK常见错误 invalid call from '~PRES8' function to 'REQ8' 解决方法
- PHP:Call to undefined function curl_init 错误解决方法
- Apache2+PHP5+MySQL时,报Call to undefined function mysql_connect() 错误解决方法
- 出现Fatal error: Call to undefined function mysql_connect()错误的解决方法
- 关于Call to undefined function mysql_connect()错误的解决方法
- 【关于DrawLine' : ambiguous call to overloaded function解决办法】
- Call to undefined function mysql_connect() 错误解决方法
- ambiguous call to overloaded function解决的办法
- MySQL This function has none of DETERMINISTIC, NO SQL...错误1418 的原因分析及解决方法
- php5.6 报错:Call to undefined function Think\Template\simplexml_load_string() 解决方法
- eclipse 中 r6025 pure virtual function call 错误的解决方法
- PHP连接MySQL报错:Fatal error: Call to undefined function mysql_connect()之解决方法
- 编绎报错,解决方法objc_msgSend too many arguments to function call,expected 0, have3 (转)