I have a makefile project comprised of many source, header and other files, which I am trying to convert to an Eclipse "native" project. The problem that the Indexer reports errors and warning on files that exist in the directories but are excluded form the build. As a consequence, large parts of my directory tree are marked with the red x
sign.
How can I make the Indexer to ignore specific file and/or directories?
Note: when defining a directory as "Derived" it is excluded form further searches, but unfortunately not from code analysis. Using project Resource Filters does not solve the problem either.
In Visual Studio, right-click on the file to be excluded from build, choose Properties, Configuration Properties -> General -> Excluded From Build -> Yes -> OK. In Eclipse, right-click on the file to be excluded from build, choose Properties, C/C++ Build -> Excluded from build -> OK.
Eclipse includes a background parser called 'Indexer' which is used to assist the developer with various kind of information, for example jumping to a variable declaration or definition. Basically it is a parser running in the background collecting information about the sources and building up that 'index' data base.
Individual files are tricky however folders should be possible. Right click on the project -> Properties -> C/C++ General -> Paths and Symbols
Have a look at the 'Source Location' tab:
Resource Configurations -> Exclude from build...
. It will exclude all selected files or folders.File Types
(in C/C++ General) and click through the other tabs of 'Paths and Symbols' and see if something can be removed...Right click on the project -> Properties -> Indexer
which can be configuredNow I hope the DS-5 guys didn't deactivate all of those options...
Update: Of course those options are also available (at least some of those) in CDT. I changed my description accordingly...
Note - this is a partial answer
Like many features in Eclipse, this is yet another option buried inside the endless configuration dialogs, and has a default setting which is contrasting the common sense...
In order to exclude indexing of files that are excluded from the build, uncheck:
Window
-> Preferences
-> C/C++
-> Indexer
-> Index source files not included in the build
I did not find yet a way of excluding files the are included in the build. Similarly, I could not find how to exclude whole directories, but if all sources in a directory are excluded from build, then with this setting unchecked, it will be excluded from indexing as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With