0

I have seen related questions asked but cannot find a simple and precise answer to the following question:

Note: updated to 4.10.0 and CDT 9.6.0, problem persists

I am using eclipse as editor, not as builder.

I have a eclipse dev project (foo) struct like this

foo/   
    src/
        bar.c  
    include/
        bar.h  
    man/  
    test/  
    etc/

make && make install creates:

    /usr/
        include/
            foo/
                bar.h

After building, the indexer pulls in both bar.h header files and all my editor files are polluted with red and unresolved references since it can't figure out which header to use.

I have tried using resource filters with no luck - files, dirs, relative paths, names, tried playing with indexer settings, include file settings, exclude from build on and on. No luck.

Please reply only if you have experience with this particular problem, I must I be missing some steps.

For example, I set up resource filter to exclude location matching /usr/include/foo and reindex and no change. Am I using this wrong?

Food for thought for any eclipse devs: maybe eclipse could recognize a ".exclude" created in a file in a folder to exclude from indexing? Or perhaps let me right-click on the eclipse discovered system include folders (i.e. /usr/include) from project browser and exclude folders of my choice?

trench_digger
  • 285
  • 2
  • 8
  • Pulling in the header file from both locations should not be a problem if the header has an include guard. – HighCommander4 Mar 16 '19 at 23:35
  • @Highcommander4 The problem isn't the compiler, as the question stated, I am just using eclipse as an editor. The problem is the eclipse indexer doesn't know which include file to use. – trench_digger Mar 17 '19 at 06:44
  • @trench_digger Did you also [tried this](https://stackoverflow.com/a/31335459/6505250)? What do you mean by _"cdt 3.8.1"_? The current version of Eclipse is 2018-12 (4.10) and of CDT 9.6 and Eclipse 3.8.1 has been released more than five years ago. – howlger Mar 17 '19 at 09:44
  • @howlger yes, I have played with these settings with no effect. Understood on version, however it's default on Ubuntu 16.04 LTS and I have not had reason to upgrade. I want to see if there is a known solution before introducing more unknowns by going through the pain of update. – trench_digger Mar 17 '19 at 13:09
  • @howlger, also you cannot exclude the eclipse-self-discovered "system" include directories using the right-click "exclude from build" option. – trench_digger Mar 17 '19 at 13:12
  • @trench_digger I'm sorry, but your question is very unclear to me and perhaps to others too. You want to exclude something from indexing, but then why do you include it in the project at all? Name and show with a screenshot how this is included in the project that you want to exclude from indexing. "Tried $title, no luck" without details has no information value. If you want to report a feature request, just do it. Those who want to help you are more interested in the problem than in what makes you feel annoyed. – howlger Mar 17 '19 at 16:18

0 Answers0