无法解析的NetBeans标识符 [英] Unable to resolve identifier on netbeans

查看:391
本文介绍了无法解析的NetBeans标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不断收到的NetBeans这个无法解析标识符文件的消息。
我在C和NetBeans新。
这是罚款昨晚但重新启动我的电脑不知何故后此消息不断出现。
这里有一个code。会是什么问题?

 的#include<&stdio.h中GT;
#包括LT&;&stdlib.h中GT;
#包括LT&;&string.h中GT;INT主(INT ARGC,字符** argv的){
  字符文件名[] =text.dat;
  CHAR [5]线;
  FILE *文件=的fopen(文件名,R);
  返回0;
}


解决方案

我知道这是一个古老的职位,但我今天遇到了同样的问题。不要太快假定一个编译器提供的头文件是有缺陷的。这情况很少见,尤其是对于头,比如stdio.h中已经存在很长时间了。

请记住,Netbeans的code援助引用包括源$ C ​​$ C内使用。由编译器使用的所有宏必须定义为Netbeans的。一个文件例如stdio.h中可以具有条件包括基于一个或多个宏。除非NetBeans是意识到这些宏时,它处理包含文件提供code援助无法应用它们。这将包含$符P $ pvent有条件的头被加载。

例如,今天我看到了,我用一个包含文件有许多条件,包括与符号Netbeans的报告说,它无法解析是在这些文件中定义。知道我是建设一个特定的处理器I确定需要适当的文件宏被列入范围内。然后,我定义的项目属性/ code援助/ C ++编译/ preprocessor定义的宏。在这一点上是Netbeans的能够解决的符号。

I'm keep getting this "Unable to resolve identifier file" message on netbeans. I'm new in c and netbeans. It was fine last night but somehow after rebooting my computer this message keep occurs. Here's a code. What would be the problem?

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char** argv) {
  char filename[] = "text.dat";
  char line[5];
  FILE *file = fopen(filename, "r");
  return 0;
}

解决方案

I know this is an old post, but I ran into the same issue today. Don't be too quick to assume a compiler-supplied header file is defective. That is rarely the case, especially for headers such as stdio.h that have been around a long time.

Keep in mind that Netbeans code assistance references the includes used within your source code. Any macros that are used by the compiler must be defined to Netbeans. A file such as stdio.h may have conditional includes based on one or more macros. Unless Netbeans is aware of those macros it cannot apply them when it processes include files to provide code assistance. This would prevent conditional headers containing symbols from being loaded.

For example, today I saw that an include file I use has many conditional includes and the symbols Netbeans reported it could not resolve were defined in those files. Knowing that I was building for a particular processor I determined the macro needed for the proper file to be included within . I then defined that macro in Project Properties/Code Assistance/C Compiler/Preprocessor Definitions. At that point Netbeans was able to resolve the symbols.

这篇关于无法解析的NetBeans标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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