C++ Netbeans 7.3突出显示错误C++;

C++ Netbeans 7.3突出显示错误C++;,c++,netbeans,C++,Netbeans,我昨天安装了Netbeans 7.3希望我安装的更新,我正在运行Ubuntu 12.04。现在,当我创建一个新项目时,netbeans会突出显示代码中的许多错误,但当我构建时,它编译并运行时没有错误 下面是一个简单的示例,我在其中添加了netbeans声称代码在注释中存在的错误 main.cpp #include <cstdlib> #include <string> #include <stdio.h> #include "hello.h" using na

我昨天安装了Netbeans 7.3希望我安装的更新,我正在运行Ubuntu 12.04。现在,当我创建一个新项目时,netbeans会突出显示代码中的许多错误,但当我构建时,它编译并运行时没有错误

下面是一个简单的示例,我在其中添加了netbeans声称代码在注释中存在的错误

main.cpp

#include <cstdlib>
#include <string>
#include <stdio.h>
#include "hello.h"
using namespace std;

int main()
{
    string s="hello";
    printf("%i\n",s.length()); //Unable to resolve identifier length
    hello h(0,0,0); //unable to resolve identifier hello
    printf("%i\n",h.z); //unable to resolve identifier z
    return 0;
}
你好,cpp

#include "hello.h"
hello::hello(int px, int py, int pz) //method hello does not have declaration
{
    x=px;
    y=py;
    z=pz;
}
我试着编译、清理和重建,重新启动netbeans,并在一个新项目中实现它,但没有任何效果。有什么想法吗


提前感谢您的帮助:)

我曾经遇到过同样的问题。我需要删除
{userdir}/var/cache/index

我在这里找到了错误报告:


我曾经有过同样的问题。我需要删除
{userdir}/var/cache/index

我在这里找到了错误报告:


我重新安装了netbeans,修复了大部分问题,其余的问题在我花了一段时间从项目中删除文件,然后再添加回来后就消失了。检查文件的属性并确保它们被设置为用C++编译而不是C也有帮助。希望这个问题不会再次困扰我。

我重新安装了netbeans,它修复了大部分问题,其余的问题在我花了一段时间从项目中删除文件,然后重新添加后就消失了。检查文件的属性并确保它们被设置为用C++编译而不是C也有帮助。希望这个问题不会再次困扰我。

不幸的是,假设我在
~/.cache/netbeans/7.3/index
找到了正确的缓存(
~/.netbeans/7.3/var
已经没有索引目录),这没有帮助。@drowdemon抱歉,我无法从一个干净的区域(没有缓存)开始很遗憾,假设我在
~/.cache/netbeans/7.3/index
~/.netbeans/7.3/var
已经没有索引目录)找到了正确的缓存,这也没用。@drowdemon很抱歉,我无法从一个干净的区域(没有缓存)开始帮我解决这个问题。
#include "hello.h"
hello::hello(int px, int py, int pz) //method hello does not have declaration
{
    x=px;
    y=py;
    z=pz;
}