错误C2064:使用VC ++时,该术语不求值 [英] error C2064: term does not evaluate to a function in using VC++

查看:234
本文介绍了错误C2064:使用VC ++时,该术语不求值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




 如果(!ValidateBaseMaterial())
        {
            sError.LoadString(IDS_ERR_BM_INACTIVE);
            AfxMessageBox(sError);
            返回;
        } 

解决方案

您没有正确定义或使用您似乎正在用作功能的符号.

可能的原因是:
-有关正确定义和使用函数指针的问题(请参阅解决方案1中的链接)
-如果还存在具有相同名称的本地符号,则无法为函数定义包括适当的标头

不幸的是,不幸的#define-macro会使您的代码混乱,但是代码中的符号看起来相当安全...


我的猜测是,不是将功能ValidateBaseMaterial的声明放入头文件中并包含该文件,而是将其复制到cpp文件中,并意外地省略了括号,如下所示:

int ValidateBaseMaterial; // <-- forgot the brackets!
 // ...
     if (!ValidateBaseMaterial())
          ^ error 2064!


另一种可能性是您在头文件中定义了类似的函数. http://msdn.microsoft.com/en-us/library/z72c1dfd (v = vs.80).aspx [if (!ValidateBaseMaterial()) { sError.LoadString(IDS_ERR_BM_INACTIVE); AfxMessageBox (sError); return; }

You didn''t properly define or use a symbol that you appear to be using as a function.

Possible causes are:
- problems with the correct definition and use of function pointers (see the link in solution 1)
- failure to include the appropriate header for the function definition, if there is also a local symbol by the same name

There is also a slim chance that an unlucky #define-macro messes with your code, but the symbols in your code are looking fairly safe...


My guess is that instead of putting the declaration of the function ValidateBaseMaterial into a header file and include that, you copied it into your cpp file and accidenttaly ommitted the brackets like this:

int ValidateBaseMaterial; // <-- forgot the brackets!
 // ...
     if (!ValidateBaseMaterial())
          ^ error 2064!


Another possibility is that you defined the function like that right in your header file.


Check this, and find your case
http://msdn.microsoft.com/en-us/library/z72c1dfd(v=vs.80).aspx[^]


这篇关于错误C2064:使用VC ++时,该术语不求值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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