views:

158

answers:

3

I'm using Eclipse with C++ code via linked resources on Linux. The code analysis index seems to be corrupted (Goto definition lands the cursor close to, but not on, the definition) Refreshing resources doesn't fix it, neither does restarting Eclipse.

Is there a way to flush the index and rebuild it?

A: 

Did you try adding -clean to the command line for the eclipse executable?

Chris Dennett
+2  A: 

Right-click on your project, go under the Index submenu, and choose either "Rebuild," "Update with modified files," or "Freshen all files."

I don't know the difference between those three options, but one of "Update with modified files" or "Freshen all files" usually fixes it for me.

Also, I'm sure you've already done this, but make sure that you're running the latest version of the Eclipse CDT. Current versions seem to have much more reliable indexing than previous versions.

Josh Kelley
In the past I've also had to sometimes close and reopen the project to get this to take for some reason.
Michael Burr
My experience showed that there has been a big improvement in Indexing in CDT 6. It is much faster (even for big projects) and more reliable. It's so good that I use CDT for editing all my C++ even if I have to build it with VS2008!
rstevens
+1  A: 

Another brute-force way is to close Eclipse, open your workspace directory and go to ".metadata\.plugins\org.eclipse.cdt.core" and delete everything in there.

This finally helps if "Freshen all Files" and friends didn't work.

rstevens