Netbeans: Navigate-> Go To Declaration/Definition

2019-07-13 13:46发布

问题:

My Netbeans right-click Navigate -> Go to Declaration/Definition is broken, it refuses to go anywhere. Instead, in the lower left-hand corner, a message pops up: 'Cannot open element: "myvariablename".' It does not matter if the variable or function I have selected to inspect is remote, global, or local to the function. Neither does it work from the upper menu Navigate -> Go to Declaration/Definition.

Netbeans is using the GNU C++ toolchain on a 64-bit Ubuntu 13.10 AMD. It uses make, compiles, and runs the complex C++ projects correctly.

I upgraded and installed a new version of Netbeans 8.0 to get rid of this, but it still happens.

There are some few cases in which it works correctly, but I have not been able to tell the difference yet. When the code does not compile and link all the way, it seems to be worse. It may be project-dependent. I could understand getting lost if the project does not compile and link, but it certainly has enough information to know where everything is.

I do not have any such problems with my other 32-bit Ubuntu machine running Netbeans 8.0. I guess it is some kind of configuration issue.

How do I get Netbeans to be able to successfully go to the source definitions of variables and functions under C++ projects? Thank you.

回答1:

"Please try to close NetBeans, delete cache dir /home/user/.cache/netbeans/8.0rc1 and start NetBeans again."

This worked for me this time.