Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse CDT "open declaration" lists the same file" twice

Using Eclipse Luna Service Release 2 (4.4.2), C and C++, although this problem relates to C code. Running Eclipse on Win XP.

I'm using a system with 2 projects. The projects are linked by Properties - Project References.

Some references work OK: I can use "open declaration" on a symbol in one project and it immediately jumps to the correct place in the 2nd project where it is defined. However, occasionally I find a symbol which brings up a dialog box "Open Declaration" listing 2 alternatives, both of which are exactly the same file (by exactly the same path). One of these choices gives the correct result, the other one gives almost the same except that it's a few lines out. Also, Eclipse (parser) thinks there are some syntax errors where there aren't any. I've rebuilt the index on both projects, tried referencing both projects to each other and also one way only. I've stopped Eclipse and restarted it.

Any solutions?

like image 348
Spalteer Avatar asked Oct 18 '25 21:10

Spalteer


1 Answers

In my case, the index was out of sync.

From the top level in the project in Project Explorer, right-click and select Index-Rebuild.

Apparently it just happens every now and then; a colleague of mine encounters it regularly (Linux build).

See info about the indexer on Eclipse help.

like image 165
radsdau Avatar answered Oct 22 '25 03:10

radsdau