eclipseavreclipse-cdtindexer

Eclipse CDT cannot resolve uint8_t and the like


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:

enter image description here

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!


Solution

  • 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:

    I then re-built the index: Right click on the project, and select from menu: Index -> Rebuild

    Caveats:

    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