|Re: Indexer doesn't find symbols [message #1152638 is a reply to message #1144398]
||Thu, 24 October 2013 05:00
| Marc-Andre Laperle
Registered: July 2009
You can double check a few things. A lot of errors can go away with proper configuration. It can be pretty hard to figure out what's going on with the indexer but here is what I would do:|
1. Since you are using a Makefile, make sure you are using the build output parser so that the indexer has a good amount of information about includes and symbols when parsing files. To do that, go in C/C++ General, Preprocessor Include paths..., Providers, make sure CDT GCC Build Output parser is checked. Next, make sure that you do a full build of your project and that the build output contains the includes and defines gcc flags such as -Imyincludepath -Dmydefine.
2. After the build, you might notice an "Indexing" job in the Progress view. Once it's done, try rebuilding the index entirely by right-clicking on the project, Index, Rebuild. Once that's done, some errors might get fixed but more interestingly, if you open the Error log view, you should see a report "Indexed 'project' ..." and somewhere on the line "unresolved inclusions". Make sure you have 0 unresolved inclusions. If not, right click on the project, Index, Search for unresolved includes. This will open a list of unresolved includes in the Search view. At this point the solutions might vary but you could have to add includes paths manually in project properties, C/C++ General, Preprocessor Include paths. To figure out which includes and symbols are used to parse a file, you can right-click on a source file, Index, Create parser log.
3. There might be a bug in the indexer. There are limitations to the indexer, the two most biggest ones that I've personally been affected the most are:
Headers with pragma-one semantics are indexed one version only, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=197989#c103
Index cannot maintain different typedefs with the same name, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=337583
If you don't think your errors come from either of those limitations, you can start looking at your errors one by one, try to reproduce the error in a small, self contain example and create a bug report with the version of CDT you are using. If you are working on an open source project it could be OK to just share the URL and the instructions on how to set it up but it's less likely to get looked at than a self contain, small sample code.
Powered by FUDForum
. Page generated in 0.03727 seconds