I'm using Eclipse CDT Mars 4.5.0 20150621-1200 on Linux for a firmware project involving AVR microcontrollers. Eclipse is giving me errors like "Type 'uint8_t' could not be resolved".
I properly added /usr/lib/avr/include to Project properties -> C/C++ General -> Paths and Symbols -> Includes.
When I try to open the declaration of uint8_t in Eclipse I get the following offerings:
This suggests me that Eclipse detected 2 declarations and cannot decide which is the right one. It's strange to me because /usr/include is not featured under Paths and Symbols -> Includes.
How to fix this pain? Thanks!
I just fixed this myself, on a project that I'd validated the indexer was working perfectly in all other ways.
Form the menu bar, I went to: Window -> Preferences -> C/C++ -> Indexer -> Cache limits
In Cache limits I changed:
Limit relative to maximum heap size from 10 to 20%
absolute limit from 256 to 512MB
I then re-built the index: Right click on the project, and select from menu: Index -> Rebuild
Caveats:
This was not on an avr Eclipse project but an Eclipse2021 project.
The indexer configuration excluded all source files not included in the build.
I have a policy of changing Eclipse's java settings in the ini file to double the memory available to java, so you might find 2 things happening without this: you might get lock ups of eclipse. you might need to double relative heap size to 40%, before you see any results.
Update: While I came to this solution myself, some quick searching revealed that CERN use this to set up their Eclipse dev env: https://wiki.jlab.org/cuawiki/images/archive/3/3c/20220829172334!Root-geant4-eclipse.pdf#page=3