Clean Eclipse Index, it is out of sync with code
Go to your project properties -> C++ general -> Indexer
.
- Do this with
'project specific settings'
,
(or on'Configure Workspace Settings...'
). - Deselect
'Enable Indexer'
hitApply
. - Select
'Enable Indexer'
hitApply
.
This should completely wipe out and rebuild the index.
From http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg10390.html, the differences between "Rebuild," "Update with modified files," or "Freshen all files":
Rebuild: Works for entire projects, only. Clears the index and indexes the files from scratch. When cancelled it leaves you with an empty or partial index.
Update with Modified Files: Works on a resource selection. Checks on individual files whether the timestamp or the scanner-config has been changed and updates the index for the changed files.
Freshen All Files: Works on a resource selection. Updates the selected files in the index. The index is not cleared, it is safe to cancel the operation.
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.